제출 #633102

#제출 시각아이디문제언어결과실행 시간메모리
633102tutis수천개의 섬 (IOI22_islands)C++17
10 / 100
32 ms4428 KiB
#include "islands.h" #include <variant> #include <vector> #include <bits/stdc++.h> using namespace std; variant<bool, vector<int>> find_journey( int N, int M, vector<int> U, vector<int> V) { if (N == 2) { vector<int>a; vector<int>b; for (int i = 0; i < M; i++) if (U[i] == 0 && V[i] == 1) a.push_back(i); else b.push_back(i); if (a.size() >= 2 && b.size() >= 1) return vector<int>({a[0], b[0], a[1], a[0], b[0], a[1]}); return false; } { int x = -1; int y = -1; int z = -1; int t = -1; for (int i = 0; i < M; i++) if (U[i] == 0 && V[i] == 1) x = i; else if (U[i] == 1 && V[i] == 0) y = i; else if (U[i] == 0 && V[i] == 2) z = i; else if (U[i] == 2 && V[i] == 0) t = i; if (min({x, y, z, t}) >= 0) return vector<int>({x, y, z, t, y, x, t, z}); } return false; }
#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...