| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1359432 | opeleklanos | Thousands Islands (IOI22_islands) | C++20 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
#include <variant>
using namespace std;
variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V){
int a = 0; int b = 0;
for(int i = 0; i<M; i++){
if(U[i] == 1) b++;
else a++;
}
if(a <2 || b<1) return (bool)0;
a = -1, b = -1; int c = -1;
for(int i = 0; i<M; i++){
if(U[i] !=0 1) c = i;
else{
if(a == -1) a = i;
else b = i;
}
}
vector<int> ans = {a, c, b, a, c, b};
return ans;
}