Last active
April 26, 2016 07:51
-
-
Save ria3100/bfce602fa49a251e9eb710038d1fc730 to your computer and use it in GitHub Desktop.
AtCoder C - オセロ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# http://abc035.contest.atcoder.jp/tasks/abc035_c | |
N, Q = map(int, input().split()) | |
piece = 0b0 | |
for _ in range(Q): | |
l, r = map(int, input().split()) | |
tmp = ['1' if l <= x <= r else '0' for x in range(1, N+1)] | |
tmp = int(''.join(tmp), 2) | |
piece = int(bin(tmp ^ piece), 2) | |
print(str(format(piece, 'b')).zfill(N)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment