제출 #332184

#제출 시각아이디문제언어결과실행 시간메모리
332184zggf게임 (IOI14_game)C++14
100 / 100
562 ms25452 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; vector<int> conv; vector<vector<int>> tab; void initialize(int n) { conv.resize(n); tab.resize(n, vector<int>(n, 1)); for(int i = 0; i < n; i++){ conv[i] = i; } } int find(int x){ if(conv[x]==x) return x; conv[x] = find(conv[x]); return conv[x]; } void merge(int a, int b){ conv[b] = a; for(int i = 0; i < tab.size(); i++){ tab[a][i] += tab[b][i]; tab[i][a] += tab[i][b]; } } int hasEdge(int u, int v) { u = find(u); v = find(v); if(tab[u][v]==1) { merge(u, v); return 1; } tab[u][v]--; tab[v][u]--; return 0; }

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

game.cpp: In function 'void merge(int, int)':
game.cpp:25:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |  for(int i = 0; i < tab.size(); i++){
      |                 ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...