# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
797643 | ChrisM2309 | Thousands Islands (IOI22_islands) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
variant<bool, vector<int>> find_journey(int N, int M, int[] U, int[] V){
int cont0 = 0, cont1 = 0;
int b1 = -1, b2 = -1, b3 = -1;
for (int i = 0; i < M; i++){
if(U[i] == 0){
cont0++;
if(b1==-1) b1 = i;
else b2 = i;
}
else cont1++;
b3 = i;
}
if(cont0 > 1 and cont1 > 0){
vector<int> ans = {b1, b3, b2, b1, b3, b2};
return ans;
}
return false;
}