# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
963452 | 2024-04-15T03:42:25 Z | Namkhing | 수천개의 섬 (IOI22_islands) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "islands.h" using namespace std; variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { int first = 0, second = 0; for (int u : U) { if (u) { second++; } else { first++; } } if (first < 2 || second < 1) { return false; } int a, b, c; for (int i = 0; i < M; i++) { if (!U[i]) { a = i; break; } } for (int i = M - 1; i >= 0; i--) { if (!U[i]) { b = i; break; } } for (int i = 0; i < M; i++) { if (U[i]) { c = i; break; } } return {a, c, b, a, c, b}; }