Rosetta Problems
← atcoder に戻る
Colorful Hats
https://atcoder.jp/contests/agc016/tasks/agc016_b