Submission #389331

#TimeUsernameProblemLanguageResultExecution timeMemory
389331wiwihoXOR Sum (info1cup17_xorsum)C++14
11 / 100
92 ms460 KiB
#include <bits/stdc++.h> #define mp make_pair #define F first #define S second #define eb emplace_back #define printv(a, b) { \ for(auto pv : a) b << pv << " "; \ b << "\n"; \ } using namespace std; typedef long long ll; using pii = pair<int, int>; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<ll> cnt(4001); int ans = 0; for(int i = 1; i <= n; i++){ int v; cin >> v; cnt[v]++; } for(int i = 1; i <= 4000; i++){ for(int j = 1; j < i; j++){ if(cnt[i] * cnt[j] % 2) ans ^= i + j; //cerr << cnt[i] << " " << cnt[j] << " " << cnt[i] * cnt[j] << " " << i + j << " " << ans << "\n"; } if(cnt[i] * (cnt[i] + 1) / 2 % 2) ans ^= i + i; } cout << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...