제출 #235895

#제출 시각아이디문제언어결과실행 시간메모리
235895Bilyana게임 (IOI14_game)C++17
42 / 100
1094 ms2936 KiB
#include <bits/stdc++.h> using namespace std; vector<bool> used; vector<vector<int>> con; void initialize(int n) { con.resize(n); used.resize(n, 0); for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { if (j == i) { continue; } con[i].push_back(j); } } } bool dfs(int curr, int par, int en) { if (curr == en) { return 1; } used[curr] = 1; for (auto to : con[curr]) { if (to != par && !used[to]) { if (dfs(to, curr, en)) { return 1; } } } return 0; } void removeEdge(int u, int v) { for (int i=0; i<con[u].size(); i++) { if (con[u][i] == v) { swap(con[u][i], con[u].back()); con[u].pop_back(); } } } int hasEdge(int u, int v) { fill(used.begin(), used.end(), 0); if (dfs(u, v, v)) { removeEdge(u, v); removeEdge(v, u); return 0; } return 1; }

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

game.cpp: In function 'void removeEdge(int, int)':
game.cpp:37:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<con[u].size(); i++) {
                   ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...