Submission #442767

#TimeUsernameProblemLanguageResultExecution timeMemory
442767JovanBFootball (info1cup20_football)C++17
100 / 100
45 ms1992 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const int MAXN = 100000; int a[MAXN+5]; void solve(){ int n, k; cin >> n >> k; ll sum = 0; for(int i=1; i<=n; i++) cin >> a[i]; while(k > 1){ for(int i=1; i<=n; i++) sum += a[i]; if(sum%2){ cout << 1; return; } k /= 2; for(int i=1; i<=n; i++) a[i] /= 2; sum = 0; } for(int i=1; i<=n; i++) sum += a[i]; cout << sum%2; } int main(){ ios_base::sync_with_stdio(false), cin.tie(0); cout.precision(10); cout << fixed; int t; cin >> t; while(t--) solve(); 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...