Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define all(x) begin(x),end(x)
- using namespace std;
- struct T {
- const vector<int>& a;
- T(const vector<int>& a) : a(a) {}
- const int* begin() {
- return a.data();
- }
- const int* end() {
- return a.data() + a.size();
- }
- };
- vector<int> f(int n) {
- vector<int> ans(n);
- iota(all(ans), 0);
- return ans;
- }
- int main() {
- int n;
- cin >> n;
- int ans = 0;
- for (const auto& x : T(f(n))) {
- ans ^= x;
- }
- cout << ans << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement