Submission #947673

#TimeUsernameProblemLanguageResultExecution timeMemory
947673fasdfhasjfaksdfjhalskdjhfFootball (info1cup20_football)C++14
26 / 100
169 ms1388 KiB
#include <bits/stdc++.h> #include <functional> #include <queue> using namespace std; int main() { int T; cin >> T; while(T--){ int N, K; cin >> N >> K; priority_queue<int> pq; for(int i = 0; i < N; i++){ int x; cin >> x; pq.push(x); } bool turn = 0; while(!pq.empty()){ int t = pq.top(); pq.pop(); turn = turn ^ 1; if(t <= K){ K = t; } else{ int r = t % K; if((t / K) % 2 == 1) turn = turn ^ 1; pq.push(r); } } cout << turn; } }
#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...