제출 #902160

#제출 시각아이디문제언어결과실행 시간메모리
902160Jawad_Akbar_JJ게임 (IOI14_game)C++17
0 / 100
1 ms360 KiB
#include <iostream> #include <vector> #include <set> #include "game.h" using namespace std; const int N = 85; vector<int> nei[N],nei2[N]; int block[N][N]; bool seen[N]; int n; set<pair<int,int>> e; void initialize(int N){ n = N; for (int i=0;i<n;i++) for (int j=i+1;j<n;j++){ e.insert({i,j}); nei[i].push_back(j); nei[j].push_back(i); block[i][j] = block[j][i] = true; } return; } void clear(){ for (int i=0;i<=n;i++) seen[i] = false; } int dfs(int u){ seen[u] = true; int a = 1; for (int i : nei[u]) if (!seen[i] and !block[u][i]) a += dfs(i); return a; } int hasEdge(int u,int v){ clear(); block[u][v] = block[v][u] = false; if (dfs(u)==n){ block[u][v] = block[v][u] = true; return 0; } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...