Submission #992064

#TimeUsernameProblemLanguageResultExecution timeMemory
992064kachim2Football (info1cup20_football)C++17
0 / 100
156 ms2076 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 (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...