Submission #389098

#TimeUsernameProblemLanguageResultExecution timeMemory
389098AlmaFootball (info1cup20_football)C++14
0 / 100
51 ms1992 KiB
#include <bits/stdc++.h> using namespace std; int e2 (int k) { int p = (int)log2(k); return (int)pow(2, p); } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int t, n, k, total; vector<int> v; cin >> t; while (t--) { cin >> n >> k; total = 0; v.assign(n, 0); for (int i = 0; i < n; i++) { cin >> v[i]; total += v[i]; } if (total % 2 == 1) { cout << 1; continue; } k = e2(k); while (k > 1) { for (int i = 0; i < n; i++) { total -= v[i] / k * k; v[i] -= v[i] / k * k; } k /= 2; } cout << !(total % 2); } cout << '\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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...