Skip to content

Instantly share code, notes, and snippets.

@IKKO-Ohta
Created July 21, 2017 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IKKO-Ohta/479d28e67e88c2f6c60218e99612ac40 to your computer and use it in GitHub Desktop.
Save IKKO-Ohta/479d28e67e88c2f6c60218e99612ac40 to your computer and use it in GitHub Desktop.
nums = [int(x) for x in input().split()]
N,M = nums[0],nums[1]
imos = [0 for i in range(N+1)]
V = 0
for i in range(M):
nums = [int(x) for x in input().split()]
a,b = nums[0]-1,nums[1]-1
imos[a] += 1
imos[b+1] -= 1
ans = []
j = 0
for i in imos:
ans.append(j+i)
j += i
ans = ans[:N]
ans = [0 for x in ans if x % 2 == 0 else 1]
print(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment