Submission #364290

#TimeUsernameProblemLanguageResultExecution timeMemory
364290AlexandruabcdeFootball (info1cup20_football)C++14
100 / 100
39 ms1388 KiB
#include <iostream> using namespace std; int a[100005]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int T = 1; cin >> T; for (; T; -- T ) { int N, K; cin >> N >> K; for (int i = 1; i <= N; ++ i ) { cin >> a[i]; } bool ans = 0; long long S = 0; for (int i = 1; i <= N; ++ i ) S += 1LL * a[i]; if (S % 2 == 1) ans = 1; while (K > 1 && !ans) { for (int i = 1; i <= N; ++ i ) a[i] /= 2; long long sum = 0; for (int i = 1; i <= N; ++ i ) sum += 1LL * a[i]; if (sum % 2 == 1) { ans = 1; break; } K /= 2; } cout << ans; } 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...