제출 #284947

#제출 시각아이디문제언어결과실행 시간메모리
284947triplem5ds게임 (IOI14_game)C++14
42 / 100
1090 ms728 KiB
#include "game.h" #include "bits/stdc++.h" using namespace std; bitset<1505> cnc[1505]; int N; void initialize(int n) { N = n; for(int i = 0; i < n; i++) for(int j = i + 1; j < n; j++) cnc[i][j] = cnc[j][i] = 1; } bitset<1505> cur; int dfs(int node){ int ans = 1; cur[node] = 0; bitset<1505> to = cur & cnc[node]; cur &= ~to; for(auto x = to._Find_first(); x < N; x = to._Find_next(x)){ ans += dfs(x); } return ans; } int hasEdge(int u, int v) { cnc[u][v] = cnc[v][u] = 0; for(int i = 0; i < N; i++)cur.set(i); if(dfs(0) != N){ cnc[u][v] = cnc[v][u] = 1; return 1; } return 0; }

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

game.cpp: In function 'int dfs(int)':
game.cpp:18:36: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
   18 |   for(auto x = to._Find_first(); x < N; x = to._Find_next(x)){
      |                                  ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...