Submission #683544

#TimeUsernameProblemLanguageResultExecution timeMemory
683544JooDdaeFootball (info1cup20_football)C++17
100 / 100
35 ms2032 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int tc, n, k, a[100100]; int main(){ cin.tie(0)->sync_with_stdio(0); cin >> tc; while(tc--) { cin >> n >> k; for(int i=1;i<=n;i++) cin >> a[i]; ll s = 0; while(1) { s = 0; for(int i=1;i<=n;i++) s += a[i]; if(k == 1 || s % 2) break; for(int i=1;i<=n;i++) a[i] = a[i]/2; k /= 2; } cout << s%2; } }
#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...