Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- BattleDev November 26, 2020
- Question 4
- """
- import sys
- def main() -> None:
- n, _ = map(int, input().split())
- ys = [0]
- y = 0
- for x in map(int, input().split()):
- y ^= x
- ys.append(y)
- print(ys, file=sys.stderr)
- assert len(ys) == n + 1
- nbs = [0] * 256
- for line in sys.stdin:
- l, r = map(int, line.split())
- nbs[ys[r + 1] ^ ys[l]] += 1
- print(' '.join(str(nb) for nb in nbs))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement