Submission #389102

#TimeUsernameProblemLanguageResultExecution timeMemory
389102AlmaFootball (info1cup20_football)C++17
0 / 100
42 ms396 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, mov, total; vector<int> v; cin >> t; while (t--) { cin >> n >> k; total = mov = 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++) { if (v[i] < k) continue; total -= v[i] / k * k; v[i] -= v[i] / k * k; mov++; } 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...