Submission #992065

#TimeUsernameProblemLanguageResultExecution timeMemory
992065kachim2Football (info1cup20_football)C++17
8 / 100
149 ms600 KiB
#include <bits/stdc++.h> #include <iostream> #include <numeric> using namespace std; int main() { int T; cin >> T; for (int t = 0; t < T; t++) { long N, K; cin >> N >> K; vector<long> classes(N, 0); for (int i = 0; i < N; i++) { cin >> classes[i]; } const long S = accumulate(classes.begin(), classes.end(), 0); if (S % 2 == 1) { cout << 1; continue; } long overtwos = 0; for (long i : classes) { if (i >= 2) overtwos++; } if(K==1){ cout << 0; continue;} if (overtwos % 2 == 1) { cout << 1; continue; } cout << 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...