제출 #387600

#제출 시각아이디문제언어결과실행 시간메모리
387600casperwangFootball (info1cup20_football)C++14
100 / 100
32 ms580 KiB
#include <bits/stdc++.h> using namespace std; #define debug(args) kout("[ " + string(#args) + " ]", args) void kout() { cerr << endl; } template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); } template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; } const int MAXN = 100000; int T, N, K; int a[MAXN]; string ans; inline int lb(int a) { return a &- a; } bool solve(int k) { int cnt = 0; for (int i = 0; i < N; i++) { cnt += (a[i] & 1); } if (cnt % 2) return true; for (int i = 0; i < N; i++) { a[i] /= 2; } return false; } signed main() { ios_base::sync_with_stdio(0), cin.tie(0); cin >> T; while (T--) { cin >> N >> K; for (int i = 0; i < N; i++) { cin >> a[i]; } bool flag = false; for (int i = 1; i <= K && !flag; i *= 2) { flag |= solve(i); } ans += (flag ? '1' : '0'); } cout << ans << '\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...