제출 #835098

#제출 시각아이디문제언어결과실행 시간메모리
835098_martynas게임 (IOI14_game)C++11
42 / 100
1086 ms532 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; const int mxn = 1505; int n; bitset<mxn> adj[mxn]; void initialize(int N) { n = N; for(int i = 0; i < N; i++) for(int j = 0; j < N; j++) { if(i != j) adj[i][j] = 1; } } bitset<mxn> visited; // check if it can be connected void dfs_could(int u) { visited[u] = true; for(int v = 0; v < n; v++) if(!visited[v]) { if(adj[u][v]) { dfs_could(v); } } } int hasEdge(int u, int v) { bool resp = false; visited.reset(); adj[u][v] = adj[v][u] = false; dfs_could(0); if(visited.count() != n) { resp = true; adj[u][v] = adj[v][u] = true; } return resp; }

컴파일 시 표준 에러 (stderr) 메시지

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