Submission #770691

#TimeUsernameProblemLanguageResultExecution timeMemory
770691borisAngelovFootball (info1cup20_football)C++17
100 / 100
29 ms2060 KiB
#include <iostream> using namespace std; const int maxn = 1000005; int n, k; int a[maxn]; void solve() { cin >> n >> k; long long sum = 0; for (int i = 1; i <= n; ++i) { cin >> a[i]; sum += a[i]; } while (sum % 2 == 0 && k != 1) { k /= 2; sum = 0; for (int i = 1; i <= n; ++i) { a[i] /= 2; sum += a[i]; } } if (sum % 2 == 1) { cout << 1; } else { cout << 0; } } void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { fastIO(); int q; cin >> q; while (q--) { solve(); } cout << endl; 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...