# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1058213 | tolbi | Thousands Islands (IOI22_islands) | C++17 | 17 ms | 3164 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;
std::variant<bool, std::vector<int>> find_journey(
int N, int M, std::vector<int> U, std::vector<int> V) {
//herkese birer path
vector<array<int,2>> lol(N-1);
for (int i = 0; i < M; i++){
if (U[i]==0){
lol[V[i]-1][0]=i;
}
else if (V[i]==0){
lol[U[i]-1][1]=i;
}
}
if (lol.size()==1){
return false;
}
vector<int> ans;
for (int i = 0; i < lol.size(); ++i)
{
ans.push_back(lol[i][0]);
ans.push_back(lol[i][1]);
}
for (int i = 0; i < lol.size(); ++i)
{
ans.push_back(lol[i][1]);
ans.push_back(lol[i][0]);
}
return ans;
}
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... |