제출 #1028145

#제출 시각아이디문제언어결과실행 시간메모리
102814542kangaroo수천개의 섬 (IOI22_islands)C++17
6.75 / 100
34 ms5912 KiB
#include "islands.h" #include <variant> #include <vector> using namespace std; std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { if (N == 2) { vector<int> s0, s1; for (int i = 0; i < M; ++i) { if (U[i] == 0) s0.push_back(i); else s1.push_back(i); } if (s0.size() >= 2 && s1.size() >= 1) { return vector<int>{s0[0], s1[0], s0[1], s0[0], s1[0], s0[1]}; } else return false; } }

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

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
#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...