제출 #845892

#제출 시각아이디문제언어결과실행 시간메모리
845892samekkkFootball (info1cup20_football)C++14
100 / 100
27 ms2140 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(a,b) for (int a = 0; a < (b); ++a) #define pb push_back #define all(t) t.begin(), t.end() const int max_N = 1e5+5; int t = 0, n = 0, k = 0; ll s = 0; int A[max_N]; int main() { // Jak suma nieparzysta to odrazu win, jak nie to dla jakies dowolnej potegi dwojki suma A[i]/2^x musi byc nieparzysta, wtedy sie da ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> t; while(t--) { cin >> n >> k; rep(i,n) cin >> A[i]; s = 0; rep(i,n) s += A[i]; if (s % 2 == 1) { cout << '1'; continue; } int ilo = 1; bool czy_OK = false; while(ilo <= k) { ll sum = 0; rep(i,n) sum += A[i] / ilo; if (sum % 2 == 1) { czy_OK = true; break; } ilo *= 2; } if (czy_OK == true) cout << '1'; else cout << '0'; } 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...