Submission #445581

# Submission time Handle Problem Language Result Execution time Memory
445581 2021-07-18T17:52:25 Z aris12345678 XORanges (eJOI19_xoranges) C++14
55 / 100
1000 ms 1820 KB
#include <bits/stdc++.h>
using namespace std;

const int mxN = 2*1e5+5;
int a[mxN];

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    for(int i = 0; i < n; i++)
        scanf("%d", &a[i]);
    while(q--) {
        int type, l, r;
        scanf("%d %d %d", &type, &l, &r);
        if(type == 1)
            a[l-1] = r;
        else {
            if(l%2 != r%2)
                printf("0\n");
            else {
                int ans = 0;
                for(int i = l-1; i < r; i+=2)
                    ans ^= a[i];
                printf("%d\n", ans);
            }
        }
    }
    return 0;
}

Compilation message

xoranges.cpp: In function 'int main()':
xoranges.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d %d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
xoranges.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |         scanf("%d", &a[i]);
      |         ~~~~~^~~~~~~~~~~~~
xoranges.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d %d %d", &type, &l, &r);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 4 ms 332 KB Output is correct
12 Correct 3 ms 332 KB Output is correct
13 Correct 6 ms 448 KB Output is correct
14 Correct 6 ms 412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1083 ms 1820 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 4 ms 332 KB Output is correct
12 Correct 3 ms 332 KB Output is correct
13 Correct 6 ms 448 KB Output is correct
14 Correct 6 ms 412 KB Output is correct
15 Execution timed out 1083 ms 1820 KB Time limit exceeded
16 Halted 0 ms 0 KB -