Submission #690804

#TimeUsernameProblemLanguageResultExecution timeMemory
690804andrei_iorgulescuFootball (info1cup20_football)C++14
100 / 100
33 ms492 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int t,n,k,a[100005]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> t; while (t--) { cin >> n >> k; for (int i = 1; i <= n; i++) cin >> a[i]; int sum = 0; for (int i = 1; i <= n; i++) sum += a[i]; while (k != 1 and sum % 2 == 0) { k /= 2; for (int i = 1; i <= n; i++) a[i] /= 2; sum = 0; for (int i = 1; i <= n; i++) sum += a[i]; } if (sum % 2 == 1) cout << 1; else cout << 0; } 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...