Submission #428424

#TimeUsernameProblemLanguageResultExecution timeMemory
428424Rouge_HugoGame (IOI14_game)C++14
0 / 100
1 ms384 KiB
#include<bits/stdc++.h> #include "game.h" #define ll long long #define fi first #define se second #define pb push_back using namespace std; int n; const int N=100; int vis[N],yes[N][N]; void dfs(int x) { if(vis[x])return; vis[x]=1; for(int it=0;it<n;it++) { int z=it,zz=x; if(z>zz)swap(z,zz); if(yes[z][zz]!=-1)continue; if(vis[it])continue; dfs(it); } } void initialize(int N) { n=N; memset(yes,0,sizeof yes); } int hasEdge(int x, int y) { if(x>y)swap(x,y); dfs(x);memset(vis,0,sizeof vis); if(vis[y]){ yes[x][y]=0; yes[y][x]=0; return 0; } yes[x][y]=1; yes[y][x]=1; return 1; } /* 4 0 1 0 2 0 3 3 1 1 2 3 2 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...