Submission #675175

#TimeUsernameProblemLanguageResultExecution timeMemory
675175vjudge1Football (info1cup20_football)C++17
100 / 100
37 ms408 KiB
#include <bits/stdc++.h> using namespace std; void main_program(); signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); int T; cin >> T; while (T--) main_program(); cout << "\n"; } int n, k, p; vector<int> v; int solve(vector<int> &a){ if (p > k) return 0; bool all0 = true; int parity = 0; for (auto i: a){ all0 &= (!i); parity ^= i; } if (all0) return 0; if (parity & 1) return 1; else{ for (auto &i: a) i >>= 1; p <<= 1; return solve(a); } } void main_program(){ cin >> n >> k; p = 1; v.resize(n); for (auto &i: v) cin >> i; cout << solve(v); }
#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...