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 "game.h"
#include <bits/stdc++.h>
using namespace std;
vector<set<int>>adj;
vector<int>res;
vector<vector<int>>connected;
void initialize(int n) {
adj.resize(n);
res.resize(n,n - 1);
connected.resize(n,vector<int>(n,0));
}
int hasEdge(int u, int v) {
if (connected[u][v])return 1;
if ((res[u] == 1 && res[v] >= 1) || (res[v] == 1 && res[u] >= 1)){
connected[u][v] = 1;
connected[v][u] = 1;
res[u]--;
res[v]--;
}
return connected[u][v];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |