Submission #689818

#TimeUsernameProblemLanguageResultExecution timeMemory
689818TomitaMateiFootball (info1cup20_football)C++14
26 / 100
101 ms1964 KiB
#include <iostream> using namespace std; int t,k,i,n,ok,s1; int long long s,v[100011]; int main() { cin>>t; while (t!=0) {ok=0; t--; cin>>n>>k; s=0; for (i=1; i<=n; i++) { cin>>v[i]; s=s+v[i]; } if (s%2==1) cout<<1; else { if (k==1) cout<<0; if (k%2==1) k--; if (n==1) { if ((v[1]/2)%2==1) cout<<1; } if (k==2) { for (i=1; i<=n; i++) { s1=s1+v[i]/2; if (v[i]%2==1) { ok=1; } } if (ok==0) cout<<1; else { if (s1%2==1) cout<<1; else cout<<0; } } } } 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...