제출 #313034

#제출 시각아이디문제언어결과실행 시간메모리
313034alexhu게임 (IOI14_game)C++14
42 / 100
1097 ms9464 KiB
/** * https://oj.uz/problem/view/IOI14_game * */ #include <bits/stdc++.h> using namespace std; vector<vector<int>>graph(1500,vector<int>(1500,0)); int N; bool dfs(){ list<int>q; vector<int>visited(N,0); q.push_back(0); visited[0]=1; while(!q.empty()){ int x=q.front(); q.pop_front(); for(int i=0;i<N;i++){ if(x!=i&&graph[x][i]!=2&&!visited[i]){ q.push_back(i); visited[i]=1; } } } return [&]()->bool{ for(int i=0;i<N;i++){ if(!visited[i]){ return false; } } return true; }(); } void initialize(int n){ N=n; } int hasEdge(int u,int v){ graph[u][v]=2; graph[v][u]=2; if(dfs()){ return 0; }else{ graph[u][v]=1; graph[v][u]=1; return 1; } } // int main(){ // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...