Submission #987633

#TimeUsernameProblemLanguageResultExecution timeMemory
987633kimGame (IOI14_game)C++17
42 / 100
1062 ms4728 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; bool adj[1505][1505]; int n; bitset<1505> vis; void dfs(int u){ vis[u]=1; for(int i=0;i<n;++i) if(!adj[u][i]&&!vis[i]) dfs(i); } void initialize(int n) { ::n=n; } int hasEdge(int u, int v) { adj[u][v]=adj[v][u]=1; vis.reset(), dfs(0); if(n!=vis.count()) adj[u][v]=adj[v][u]=0; return !adj[u][v]; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:20:6: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  if(n!=vis.count()) adj[u][v]=adj[v][u]=0;
      |     ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...