Submission #418236

#TimeUsernameProblemLanguageResultExecution timeMemory
418236dolphingarlicFootball (info1cup20_football)C++14
34 / 100
33 ms1248 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; int dp[101][101]; int main() { cin.tie(0)->sync_with_stdio(0); for (int k = 1; k <= 100; k++) { for (int i = 0; i <= 100; i++) { unordered_set<int> mex; for (int j = 1; j <= min(i, k); j++) mex.insert(dp[j][i - j]); for (int j = 0; ; j++) if (!mex.count(j)) { dp[k][i] = j; break; } } } int t; cin >> t; while (t--) { int n, k; cin >> n >> k; ll nimber = 0; for (int i = 1; i <= n; i++) { ll sz; cin >> sz; if (k == 1) nimber ^= (sz & 1); else nimber ^= dp[k][sz]; } cout << (nimber != 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...