Submission #667161

#TimeUsernameProblemLanguageResultExecution timeMemory
667161divadFootball (info1cup20_football)C++14
100 / 100
31 ms2064 KiB
#include <iostream> #include <algorithm> #include <cstring> #define int long long #define MAX 1000002 using namespace std; int t,n,k,a[MAX],nrp,tmp,s,c[MAX],lst,maxi; bool gasit; pair<int, int> st[MAX]; bool check(){ s = 0; for(int i = 1; i <= n; i++){ s += a[i]; } return (s%2); } void solve(){ cin >> n >> k; for(int i = 1; i <= n; i++){ cin >> a[i]; } if(check()){ cout << "1"; return ; } while(k > 1){ for(int i = 1; i <= n; i++){ a[i] /= 2; } k /= 2; if(check()){ cout << "1"; return ; } } cout << "0"; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> t; while(t--){ solve(); } 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...