/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 532.0 KiB
#2 Accepted 3ms 532.0 KiB
#3 Accepted 5ms 532.0 KiB
#4 Accepted 5ms 572.0 KiB
#5 Accepted 20ms 840.0 KiB
#6 Accepted 6ms 532.0 KiB
#7 Accepted 28ms 1.02 MiB
#8 Accepted 44ms 1.57 MiB

Code

#include <bits/stdc++.h>
using namespace std;
using namespace chrono;

int prefix(int n) {
    return vector<int>{n, 1, n+1, 0}[n % 4];
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t; cin >> t;
    for (int i = 1; i <= t; i++) {
        int n; cin >> n;
        cout << prefix(n) << "\n";
    }
}

Information

Submit By
Type
Submission
Problem
P1009 XOR Love
Language
C++17 (G++ 13.2.0)
Submit At
2025-07-14 18:16:11
Judged At
2025-07-14 18:16:11
Judged By
Score
100
Total Time
44ms
Peak Memory
1.57 MiB