Accepted
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