제출 #752107

#제출 시각아이디문제언어결과실행 시간메모리
752107StickfishFootball (info1cup20_football)C++17
100 / 100
125 ms3040 KiB
#include <iostream> #include <bitset> #include <vector> using namespace std; bool get_ans(vector<int> a, int k) { int n = a.size(); int bt = 0; for (int i = 0; i < n; ++i) bt ^= a[i] & 1; if (bt) return true; if (k == 1) return false; // first to substract odd loses for (int i = 0; i < n; ++i) a[i] /= 2; return get_ans(a, k / 2); } signed main() { int t; cin >> t; vector<bool> ans(t); for (int i = 0; i < t; ++i) { int n, k; cin >> n >> k; vector<int> a(n); for (int j = 0; j < n; ++j) cin >> a[j]; ans[i] = get_ans(a, k); } for (int i = 0; i < t; ++i) cout << ans[i]; cout << '\n'; }
#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...