제출 #1027572

#제출 시각아이디문제언어결과실행 시간메모리
1027572vjudge1Football (info1cup20_football)C++17
50 / 100
20 ms544 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 32 #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||x>k)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...