Submission #848441

#TimeUsernameProblemLanguageResultExecution timeMemory
848441MinhQNgoXORanges (eJOI19_xoranges)Pypy 3
12 / 100
1037 ms39084 KiB
n, q = map(int, input().split())
a = [int(x) for x in input().split()]

for _ in range(q):
    act_type, x, y = map(int, input().split())

    if act_type == 1:
        a[x - 1] = y
    else:
        res = 0
        x -= 1
        y -= 1
        for d in range(1, y - x + 2):
            total_xor_of_seq_len_d = 0
            for i in range(x, y - d + 2):
                total_xor_of_seq = 0
                for j in range(i, i + d):
                    total_xor_of_seq ^= a[j]
                total_xor_of_seq_len_d ^= total_xor_of_seq
            res ^= total_xor_of_seq_len_d
        print(res)
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...