제출 #627262

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6272622022-08-12 11:45:10model_code수천개의 섬 (IOI22_islands)C++17
26 / 100
1105 ms745980 KiB
// failed/solution-bidirectional.cpp
#include "islands.h"
#include <bits/stdc++.h>
#define edge std::pair<int,int>
std::variant<bool, std::vector<int>> find_journey(int, int M, std::vector<int> U, std::vector<int> V) {
// adj vector
std::vector<edge> path[1111], path_rev[1111];
for (int i = 0; i < M; i++){
path[U[i]].push_back({V[i], i});
path_rev[V[i]].push_back({U[i], i});
}
// move forward until we find a node with > 1 new outdegree (not including the one we come from)
int curr_pos = 0;
int prev = -1;
std::vector<int> sol, tmp;
while (true) {
if (curr_pos == 0 && path[curr_pos].size() == 0) // dead-end
return false;
else if (curr_pos != 0 && path[curr_pos].size() == 1) // dead-end
return false;
// we're at the 0, and and only have 1 path forward
else if (curr_pos == 0 && path[curr_pos].size() == 1) {
int idx = 0;
prev = curr_pos;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...