Submission #389124

#TimeUsernameProblemLanguageResultExecution timeMemory
389124AlmaFootball (info1cup20_football)C++14
100 / 100
42 ms1372 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ios::sync_with_stdio(false); cin.tie(NULL); ll t, n, k, total; vector<ll> 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; } while (k > 1 && total % 2 == 0) { for (int i = 0; i < n; i++) { total -= v[i]; v[i] /= 2; total += v[i]; } k /= 2; } if (k > 1) cout << 1; else if (total % 2 == 1) cout << 1; else cout << 0; } 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...