# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
632030 | TimDee | Thousands Islands (IOI22_islands) | C++17 | 36 ms | 5952 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;
variant<bool, std::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;
}
if (n<=400 && m==n*(n-1)) {
int a,b,c,d;
for (int i=0; i<m; ++i) {
if (u[i]==0 && v[i]==1) a=i;
if (u[i]==0 && v[i]==2) b=i;
if (u[i]==1 && v[i]==0) c=i;
if (u[i]==2 && v[i]==0) d=i;
}
vector<int> r = {a,c,b,d,c,a,d,b};
return r;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |