Submission #729162

#TimeUsernameProblemLanguageResultExecution timeMemory
729162sofija6Game (IOI14_game)C++14
42 / 100
1076 ms12784 KiB
#include <bits/stdc++.h> #define MAXN 1510 using namespace std; set<int> G[MAXN],a,b; int N; void initialize(int n) { N=n; for (int i=0;i<n;i++) { for (int j=0;j<n;j++) { if (i!=j) G[i].insert(j); } } } void DFS(int i,pair<int,int> skipp,set<int> &s) { s.insert(i); for (int next : G[i]) { if ((i==skipp.first && next==skipp.second) || (i==skipp.second && next==skipp.first)) continue; if (!s.count(next)) { s.insert(next); DFS(next,skipp,s); } } } bool Check(int u,int v) { a.clear(); b.clear(); DFS(u,{u,v},a); DFS(v,{u,v},b); return (a.size()!=N || b.size()!=N); } int hasEdge(int u, int v) { if (Check(u,v)) return 1; G[u].erase(v); G[v].erase(u); return 0; }

Compilation message (stderr)

game.cpp: In function 'bool Check(int, int)':
game.cpp:38:21: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   38 |     return (a.size()!=N || b.size()!=N);
      |             ~~~~~~~~^~~
game.cpp:38:36: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   38 |     return (a.size()!=N || b.size()!=N);
      |                            ~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...