Submission #675253

#TimeUsernameProblemLanguageResultExecution timeMemory
675253hotboy2703Football (info1cup20_football)C++14
50 / 100
32 ms512 KiB
#include<bits/stdc++.h> using namespace std; int a[100100]; int b[100100]; int main(){ ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr); int t; cin>>t; while (t--){ int n,k; cin>>n>>k; for (int i = 1;i <= n;i++)cin>>a[i]; while (1){ long long cnt[2] = {}; for (int i = 1;i <= n;i ++)cnt[a[i] & 1]+=a[i]; if (k == 1){ cout<<(cnt[1]&1); break; } else{ if (cnt[1] & 1){ cout<<1; break; } else{ if (cnt[1]){ int len_b = 0; for (int i = 1;i <= n;i ++){ if ((a[i] & 1) == 0)b[++len_b] = a[i]; } n = len_b; for (int i = 1;i<= n;i++)a[i] = b[i]; } else{ }k /= 2; for (int i =1;i <=n;i++)a[i] /= 2; } } } } 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...