Submission #1100710

#TimeUsernameProblemLanguageResultExecution timeMemory
1100710Kirill22Football (info1cup20_football)C++17
42 / 100
36 ms1548 KiB
#include "bits/stdc++.h" using namespace std; void solve() { int n, k; cin >> n >> k; map<int, int> cnt; for (int i = 0; i < n; i++) { int x; cin >> x; cnt[x]++; } vector<int> a; for (auto& [x, y] : cnt) { if (y % 2) { a.push_back(x); } } for (int x = 1; x <= k; x++) { long long sum = 0; for (auto& y : a) { sum += y / x; } if (sum % 2) { cout << 1; return; } } cout << 0; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t = 1; cin >> t; while (t--) { solve(); } }
#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...