# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1058479 | tolbi | Thousands Islands (IOI22_islands) | C++17 | 17 ms | 5212 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) {
vector<vector<pair<int,int>>> arr(N);
for (int i = 0; i < M; i++){
arr[U[i]].push_back({V[i],i});
}
if (arr[0].size()==0) {
return false;
}
if (arr[0].size()>=2){
int a = arr[0][0].first;
int b = arr[0][1].first;
if (a==b){
return vector<int>{arr[0][0].second,arr[a][0].second,arr[0][1].second,arr[0][0].second,arr[a][0].second,arr[0][1].second};
}
else {
return vector<int>{
arr[0][0].second,
arr[0][0].second^1,
arr[0][1].second,
arr[0][1].second^1,
arr[0][0].second^1,
arr[0][0].second,
arr[0][1].second^1,
arr[0][1].second
};
}
# | 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... |