제출 #519812

#제출 시각아이디문제언어결과실행 시간메모리
519812ACE_게임 (IOI14_game)C++14
100 / 100
298 ms29524 KiB
#include "game.h" #include<bits/stdc++.h> #define maxn 1505 using namespace std; int p[maxn], c[maxn], sz; vector<int> x[maxn]; void initialize(int n) { for (int i = 0; i < n; i++) p[i] = i, c[i] = 0; sz = 1; } int hasEdge(int u, int v) { if (p[v] == 1) swap(u, v); if (p[v] != 1 && p[u] != 1) { x[u].push_back(v), x[v].push_back(u); return 0; } if (c[v] == sz - 1) { for (int j = 0; j < x[v].size(); j++) c[x[v][j]]++; p[v] = 1; sz++; return 1; } c[v]++; return 0; }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:18:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   for (int j = 0; j < x[v].size(); j++) c[x[v][j]]++;
      |                   ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...