제출 #1037560

#제출 시각아이디문제언어결과실행 시간메모리
1037560sleepntsheep수천개의 섬 (IOI22_islands)C++17
6.75 / 100
28 ms8284 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) { vector<vector<int>> a(N); for (int i = 0; i < M; ++i) a[U[i]].push_back(i); if (N==2){ if(a[0].size()>=2&&a[1].size()){ int a1=a[0][0],a2=a[0][1],a3=a[1][0]; return vector<int>{a1, a3, a2, a1, a3, a2}; } return false; }else if(N<=400){ static int id[401][401]; for(int i=0;i<M;++i)id[U[i]][V[i]]=i; int a1=id[0][1],a2=id[1][0],a3=id[1][2],a4=id[2][1],a5=id[5][6],a6=id[6][5]; return vector<int>{a1,a3,a5,a6,a4,a2,a5,a3,a1,a2,a4,a6}; } }

컴파일 시 표준 에러 (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:9:28: warning: control reaches end of non-void function [-Wreturn-type]
    9 |     vector<vector<int>> a(N);
      |                            ^
#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...