제출 #1074106

#제출 시각아이디문제언어결과실행 시간메모리
1074106Zicrus수천개의 섬 (IOI22_islands)C++17
6.75 / 100
21 ms4420 KiB
#include <bits/stdc++.h> #include "islands.h" using namespace std; typedef long long ll; variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { ll cnt0 = 0, cnt1 = 0; for (auto &e : U) (e ? cnt1 : cnt0)++; if (cnt0 >= 2 && cnt1 >= 1) { vector<int> res; for (int i = 0; i < M && res.size() < 2; i++) { if (U[i] == 0) { res.push_back(i); } } for (int i = 0; i < M && res.size() < 3; i++) { if (U[i] == 1) { res.insert(++res.begin(), i); } } for (int i = 0; i < 3; i++) res.push_back(res[i]); return res; } return false; } #ifdef TEST #include "grader.cpp" #endif
#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...