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 "game.h"
using namespace std;
int nodes;
std::vector<int> to_ask;
std::vector<bool> connected;
void initialize(int n) {
nodes = n;
to_ask.assign(n, n-1);
connected.assign(n, false);
}
int hasEdge(int u, int v) {
if((to_ask[u]==1 and !connected[u]) or (to_ask[v]==1 and !connected[v])) {
to_ask[u]--;
to_ask[v]--;
connected[u] = true;
connected[v] = true;
return 1;
}
else {
to_ask[u]--;
to_ask[v]--;
return 0;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |