Submission #975205

#TimeUsernameProblemLanguageResultExecution timeMemory
975205ziewaczXOR Sum (info1cup17_xorsum)C++17
7 / 100
106 ms131072 KiB
#include <bits/stdc++.h> #define debug(x...) cerr << "[" #x "]: ", [](auto... $) {((cerr << $ << "; "), ...); }(x), cerr << '\n' using namespace std; typedef long long ll; typedef long double ld; constexpr int MOD = 1000000007; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } vector<int> sumy; for(int i = 0; i < n; i++) { for(int j = i; j < n; j++) { sumy.push_back(a[i] + a[j]); } } int ans = sumy[0]; for(int i = 1; i < sumy.size(); i++) { ans ^= sumy[i]; } cout << ans; return 0; }

Compilation message (stderr)

xorsum.cpp: In function 'int main()':
xorsum.cpp:26:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for(int i = 1; i < sumy.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
#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...