# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
947671 | fasdfhasjfaksdfjhalskdjhf | Football (info1cup20_football) | C++14 | 175 ms | 2156 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 == 0) turn = 0;
else turn = 1;
pq.push(t % K);
}
}
cout << turn;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |