제출 #39270

#제출 시각아이디문제언어결과실행 시간메모리
39270faustaadp게임 (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) { tt++; if(u>v) swap(u,v); b[u][v]=0; memset(be,0,sizeof(be)); rmt(u); if(be[v]!=tt) { 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...