# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
632177 | Minindu2006 | Thousands Islands (IOI22_islands) | C++17 | 32 ms | 5068 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>
#include <variant>
#include <vector>
using namespace std;
int n, m;
vector<int> u, v;
std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) {
n = N, m = M;
u = U, v = V;
vector<int> ans;
if(n <= 2)
{
if(m <= 2)
return false;
int z = 0;
vector<int> cur(3);
for(int i=0;i<m;i++)
{
if(u[i] == 0)
{
if(z < 2)
cur[z] = i;
z++;
}
else
cur[2] = i;
}
if(z < 2 || z == m)
return false;
ans.resize(3);
ans[0] = cur[0];
ans[1] = cur[2];
ans[2] = cur[1];
for(int i=0;i<3;i++)
ans.push_back(ans[i]);
return ans;
}
int a, b, c, d;
for(int i=0;i<m;i++)
{
if(u[i] == 0 && v[i] == 1)
a = i;
if(u[i] == 1 && v[i] == 0)
b = i;
if(u[i] == 0 && v[i] == 2)
c = i;
if(u[i] == 2 && v[i] == 0)
d = i;
}
return vector<int> ({a, b, c, d, b, a, d, c});
}
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... |