Submission #1146459

#TimeUsernameProblemLanguageResultExecution timeMemory
1146459NurislamXOR Sum (info1cup17_xorsum)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; //#define int long long typedef long long ll; signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n; cin >> n; vector<int> a(n); for(int &i : a)cin >> i; ll ans = 0; for(int i = 0; i < n; i++){ for(int j = 0; j <= i; j++){ ans ^= (a[i] + a[j]) } } cout << ans << '\n'; };

Compilation message (stderr)

xorsum.cpp: In function 'int main()':
xorsum.cpp:21:45: error: expected ';' before '}' token
   21 |                         ans ^= (a[i] + a[j])
      |                                             ^
      |                                             ;
   22 |                 }
      |                 ~