# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
632071 | TimDee | 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 "islands.h"
#include <bits/stdc++.h>
using namespace std;
int n,m;
vector<int> u,v;
vector<int> vis(1e5+3,0);
vector<int> par(1e5+3,-1);
vector<vector<int>> adj(1e5+3,vector<int>(0));
variant<bool, std::vector<int>>
//vector<int>
find_journey(int N, int M, vector<int> U, vector<int> V) {
n=N,m=M,u=U,v=V;
if (n==2) {
vector<int> fv,sv;
for (int x=0; x<m; ++x) if (u[x]==0) fv.push_back(x); else sv.push_back(x);
int f=fv.size(), s=sv.size();
if (f>=2 && s) {
vector<int> r={fv[0],sv[0],fv[1],fv[0],sv[0],fv[1]};;
return r;
}
else return false;
}
vector<vector<int>>__p2(n,vector<int>(n,0));
int _p2=1;
for (int i=0; i<m; ++i) {