제출 #389100

#제출 시각아이디문제언어결과실행 시간메모리
389100AlmaFootball (info1cup20_football)C++14
8 / 100
45 ms460 KiB
#include <bits/stdc++.h> using namespace std; int e2 (int k) { int p = (int)log2(k); return (int)pow(2, p); } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int t, n, k, mov, total; vector<int> v; cin >> t; while (t--) { cin >> n >> k; total = mov = 0; v.assign(n, 0); for (int i = 0; i < n; i++) { cin >> v[i]; total += v[i]; } if (total % 2 == 1) { cout << 1; continue; } k = e2(k); while (k > 1) { for (int i = 0; i < n; i++) { if (v[i] < k) continue; total -= v[i] / k * k; v[i] -= v[i] / k * k; mov++; } k /= 2; } cout << mov % 2; } 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...