Submission #1027564

#TimeUsernameProblemLanguageResultExecution timeMemory
1027564vjudge1Football (info1cup20_football)C++17
26 / 100
21 ms600 KiB
#include<bits/stdc++.h> using namespace std; #define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define ll long long #define int long long int //#define endl '\n' #define N 2100 #define M 30 #define big 2147483647 #define bigg 9223372036854775807 #define pb push_back #define p push #define ins insert #define f first #define s second signed main(){ lalala; int test;cin>>test; while(test--){ int n,k;cin>>n>>k; int top=0; for(int i=0;i<n;i++){ int x;cin>>x; top+=x; } //cout<<top<<endl; if(k==1){ if(top%2==0)cout<<0; else cout<<1; } else{ int ok=0; for(int i=0;i<M;i++){ int x=((ll)1<<i); if(x>top)break; if(top%x==0){ if((top/x)%2){ ok=1;break; } } } cout<<ok; } } cout<<endl; }
#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...