제출 #1016859

#제출 시각아이디문제언어결과실행 시간메모리
1016859onbert게임 (IOI14_game)C++17
42 / 100
1079 ms6748 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int maxn = 1505; int n; int adj[maxn][maxn]; bool vis[maxn]; void dfs(int u) { vis[u] = true; for (int i=0;i<n;i++) if (adj[u][i] && !vis[i]) dfs(i); } void initialize(int N) { n = N; for (int i=0;i<n;i++) for (int j=0;j<n;j++) adj[i][j] = 1; } int hasEdge(int u, int v) { adj[u][v] = adj[v][u] = 0; for (int i=0;i<n;i++) vis[i] = false; dfs(0); for (int i=0;i<n;i++) if (!vis[i]) { adj[u][v] = adj[v][u] = 1; return true; } return false; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...