Submission #838124

# Submission time Handle Problem Language Result Execution time Memory
838124 2023-08-26T09:06:06 Z BlockOG XORanges (eJOI19_xoranges) C++14
0 / 100
1000 ms 5336 KB
#include <iostream>

using namespace std;

int main() {
    int n, q; cin >> n >> q;
    unsigned int o[n]; for (int i = 0; i < n; i++) cin >> o[i];

    for (int it = 0; it < q; it++) {
        int code; cin >> code;
        if (code == 1) {
            int i; cin >> i >> o[--i];
        } else {
            int u, l; cin >> u >> l;
            if (!(u - l + 1 & 1)) continue;

            unsigned int res = 0;
            for (int i = u - 1; i < l; i += 2) {
                res ^= o[i];
            }
            cout << res << endl;
        }
    }
}

Compilation message

xoranges.cpp: In function 'int main()':
xoranges.cpp:15:25: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
   15 |             if (!(u - l + 1 & 1)) continue;
      |                   ~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 5336 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -