Submission #791870

#TimeUsernameProblemLanguageResultExecution timeMemory
791870caganyanmazGame (IOI14_game)C++14
42 / 100
1085 ms12820 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; constexpr static int MXSIZE = 1500; int ans[MXSIZE][MXSIZE]; set<int> g[MXSIZE]; int nc[MXSIZE]; bitset<MXSIZE> visited; int n; void initialize(int nn) { n = nn; 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) { visited[i] = 1; for (int c : g[i]) if (!visited[c]) dfs(c); } int hasEdge(int u, int v) { g[u].erase(v); g[v].erase(u); visited.reset(); dfs(0); if (visited.count() == n) return 0; g[u].insert(v); g[v].insert(u); return 1; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:37:29: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   37 |         if (visited.count() == n)
      |             ~~~~~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...