제출 #901977

#제출 시각아이디문제언어결과실행 시간메모리
901977Muhammad_Aneeq게임 (IOI14_game)C++17
42 / 100
1037 ms5672 KiB
#include <vector> #include "game.h" using namespace std; int const N=1500; int ed[N][N]={}; bool vis[N]={}; int n; void dfs(int i) { vis[i]=1; for (int j=0;j<n;j++) { if (!vis[j]&&ed[i][j]) dfs(j); } } void initialize(int nn) { n=nn; for (int i=0;i<n;i++) { for (int j=0;j<n;j++) ed[i][j]=1; } } int hasEdge(int u, int v) { ed[u][v]=ed[v][u]=0; for (int i=0;i<n;i++) vis[i]=0; dfs(0); for (int i=0;i<n;i++) { if (!vis[i]) { ed[u][v]=ed[v][u]=1; return 1; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...