제출 #825716

#제출 시각아이디문제언어결과실행 시간메모리
825716top34051수천개의 섬 (IOI22_islands)C++17
5 / 100
24 ms4412 KiB
#include "islands.h" #include <variant> #include <vector> std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) { // Subtask 1 if (N == 2) { std::vector<int> way, yaw; for (int i = 0; i < M; ++i) { int u = U[i], v = V[i]; if (u == 0) { way.push_back(i); } else { yaw.push_back(i); } } if ((int)way.size() >= 2 && (int)yaw.size() >= 1) { return std::vector({way[0], yaw[0], way[1], way[0], yaw[0], way[1]}); } } 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:13:21: warning: unused variable 'v' [-Wunused-variable]
   13 |       int u = U[i], v = V[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...