제출 #788933

#제출 시각아이디문제언어결과실행 시간메모리
788933LeaRouseFootball (info1cup20_football)C++14
16 / 100
36 ms424 KiB
#include<bits/stdc++.h> #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(); #define ll long long using namespace std; int A[100005]; int n,k; int awa(){ ll a=0,s=0; for(int i=0;i<n;i++){ cin>>A[i]; s+=A[i]; if(A[i]%2==1){ a++; } } if(s%2==1) return 1; if(k==1) return 0; s-=a; s/=2; if(s%2==0) return 0; else return 1; } void go(){ cin>>n>>k; if(k==2){ cout<<awa(); } else{ int res=0; for(int i=0;i<n;i++){ cin>>A[i]; int a=0; while(A[i]%2==0){ A[i]/=2; a*=2; } if(k>=a) res^=1; } cout<<res; } } int main(){ fastio; int t; cin>>t; while(t--){ go(); } 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...