Submission #914717

#TimeUsernameProblemLanguageResultExecution timeMemory
914717NValchanovFootball (info1cup20_football)C++17
0 / 100
25 ms856 KiB
#include<bits/stdc++.h> #define endl '\n' using namespace std; typedef long long ll; const ll MAXN=1e5+10; ll a[MAXN],n,k,sum; void solve() { if(k==1) { cout<<1; return; } while(sum>0&&k>0) { if(k==1||sum%2==1) { cout<<1; return; } k/=2; sum=0; for(ll i=1;i<=n;i++) { a[i]/=2; sum+=a[i]; } if(k==1||sum%2==1) { cout<<1; return; } } cout<<0; } void read() { cin>>n>>k; sum=0; for(ll i=1;i<=n;i++) { cin>>a[i]; sum+=a[i]; } } int main() { #ifdef ONLINE_JUDGE freopen(".in", "r", stdin); freopen(".out", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); ll t; cin>>t; while(t--) { read(); solve(); } cout<<endl; 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...