제출 #987633

#제출 시각아이디문제언어결과실행 시간메모리
987633kim게임 (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]; }

컴파일 시 표준 에러 (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...