# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
736602 | ngano_upat_na | Game (IOI14_game) | C++17 | 0 ms | 0 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 "game.h"
using namespace std;
int ct, N;
vector<pair<int,int>> v;
void initialize(int n) {
ct = n * (n - 1) / 2;
N = n;
for (int i=0; i<n-2; i++) {
v.push_back({i,i+1});
}
}
int hasEdge(int u, int v) {
int U = min(u,v), V = max(u,v);
ct--;
if (binary_search(v.begin(),v.end(),{U,V}) || ct == 0) {
return 1;
}
return 0;
}