# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163487 | giorgikob | Game (IOI14_game) | C++14 | 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 "game.h"
const int N = 1e5+69;
int A[N];
void initialize(int n) {
for(int i=0;i<n;i++)
A[i]=n-1;
}
int hasEdge(int u, int v) {
if(A[u]>2 && A[v]>2)return 0;
A[u]--,A[v]--;
if(A[u]==0 || A[v]==0)return 1;
if(A[u]==1){
if(k==2){
return 1;
} else {
k++;
}
}
if(A[v]==1){
if(k==2){
return 1;
} else {
k++;
}
}
return 0;
}