# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
431887 | REALITYNB | 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;
vector<vector<int>> lft;
vector<int> cnt ;
void initialize(int n){
lft.resize(n,vector<int>(n,-1)) ;
cnt.resize(n) ;
for(int i=0;i<n;i++) cnt[i]=n-1-i ;
return ;
}
int hasedge(int a , int b){
if(a>b) swap(a,b);
if(lft[a][b]!=-1){
return lft[a][b];
}
cnt[a]--;
if(cnt[a]){
lft[a][b]=0 ;
return lft[a][b];
}
lft[a][b]=1;
return 1 ;
}