제출 #1058394

#제출 시각아이디문제언어결과실행 시간메모리
1058394tolbi수천개의 섬 (IOI22_islands)C++17
0 / 100
1 ms604 KiB
#include "islands.h" #include <bits/stdc++.h> 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<pair<int,int>>> arr(N); for (int i = 0; i < M; i++){ arr[U[i]].push_back({V[i],i}); } for (int i = 0; i < N; ++i) { sort(arr[i].begin(), arr[i].end()); } if (arr[0].size()<=1) { assert(false); return false; } int a = arr[0][0].first; int b = arr[0][1].first; if (a==b){ return vector<int>{arr[0][0].second,arr[a][0].second,arr[0][1].second,arr[0][0].second,arr[a][0].second,arr[0][1].second}; } else { return vector<int>{arr[0][0].second,arr[a][0].second,arr[0][1].second,arr[b][0].second,arr[a][0].second,arr[0][0].second,arr[b][0].second,arr[0][1].second}; } }
#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...