제출 #374628

#제출 시각아이디문제언어결과실행 시간메모리
374628Alex_tz307Football (info1cup20_football)C++17
100 / 100
40 ms2156 KiB
#include <bits/stdc++.h> using namespace std; const int NMAX = 1e5 + 5; int a[NMAX]; int solve(int N, int K) { int sum = 0; for(int i = 1; i <= N; ++i) sum = (sum + a[i]) % 2; if(K == 1 || sum) return sum; for(int i = 1; i <= N; ++i) a[i] >>= 1; return solve(N, K >> 1); } void test_case() { int N, K; cin >> N >> K; for(int i = 1; i <= N; ++i) cin >> a[i]; cout << solve(N, K); } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int T; cin >> T; for(int tc = 0; tc < T; ++tc) test_case(); }
#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...