제출 #814580

#제출 시각아이디문제언어결과실행 시간메모리
814580LIF수천개의 섬 (IOI22_islands)C++17
0 / 100
1170 ms2097152 KiB
#include "islands.h" #include<bits/stdc++.h> #include <variant> #include <vector> using namespace std; int ind[300005]; int ph[1005][1005]; vector<int> vv[300005]; bool can[300005]; void dfs(int now,int fa) { can[now] = true; for(int i=0;i<vv[now].size();i++) { int go = vv[now][i]; if(go != fa)dfs(go,now); } } std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { for(int i=0;i<M;i++) { vv[U[i]].push_back(V[i]); vv[V[i]].push_back(U[i]); ind[U[i]]++; ind[V[i]]++; } dfs(0,-1); if(ind[0] >= 2)return true; for(int i=1;i<N;i++) { if(ind[i] >= 3 && can[i] == true)return true; } /* if (N == 4) { return std::vector<int>({0, 1, 2, 4, 0, 3, 2, 1, 4, 3}); } return false;*/ return true; }

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

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