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 <algorithm>
using namespace std;
int N;
void initialize(int n) {
N = n;
}
int ucnt;
bool used[1505];
int hasEdge(int u, int v) {
if(used[u] && used[v]) return 1;
if(!used[u] && !used[v]){
if(ucnt < N-2){
used[u] = true;
used[v] = true;
ucnt += 2;
return 1;
}else{
return 0;
}
}
if(used[u] && !used[v]) swap(u,v);
if(ucnt < N-1){
used[u] = true;
ucnt++;
return 1;
}
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... |