Submission #313033

#TimeUsernameProblemLanguageResultExecution timeMemory
313033alexhuGame (IOI14_game)C++14
Compilation error
0 ms0 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; 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; } } 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; }(); }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:14:8: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   14 |     if(dfs()){
      |        ^~~
      |        ffs
game.cpp:13:16: warning: control reaches end of non-void function [-Wreturn-type]
   13 |     graph[v][u]=2;