Submission #779468

#TimeUsernameProblemLanguageResultExecution timeMemory
779468DaktoGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int n; vector<set<int>> gr; void initialize(int N){ n=N; gr.resize(n); for(int i=0; i<n; i++){ for(int j=i+1; j<n; j++){ gr[i].insert(j); gr[j].insert(i); } } } int hasEdge(int u, int v){ vector<bool> seen(n,0); queue<int> q; q.push(u); seen[u]=1; while(!q.empty){ auto t=q.front(); if(t==v){ gr[u].erase(v); gr[v].erase(u); return 0; } for(auto i:gr[t]){ if(t==u && i==v) continue; if(!seen[i]){ seen[i]=1; q.push(i); } } } return 1; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:25:14: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool'
   25 |     while(!q.empty){
      |              ^~~~~
game.cpp:25:14: error: in argument to unary !
   25 |     while(!q.empty){
      |            ~~^~~~~