Submission #39223

#TimeUsernameProblemLanguageResultExecution timeMemory
39223faustaadpGame (IOI14_game)C++14
42 / 100
1000 ms29608 KiB
#include "game.h" #include<bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; ll N,i,j,b[1551][1551],be[1551],tt; void initialize(int n) { N=n; for(i=0;i<N;i++) for(j=0;j<N;j++) b[i][j]=1; } void rmt(ll aa) { be[aa]=tt; ll ii; for(ii=0;ii<N;ii++) if(b[min(ii,aa)][max(ii,aa)]==1&&be[ii]!=tt) rmt(ii); } int hasEdge(int u, int v) { if(u>v) swap(u,v); b[u][v]=0; memset(be,0,sizeof(be)); tt++; rmt(u); if(be[v]!=tt) { //cout<<"ds"; b[u][v]=1; return 1; } else return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...