# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
639773 | study | Thousands Islands (IOI22_islands) | C++17 | 50 ms | 16392 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 <bits/stdc++.h>
#include "islands.h"
using namespace std;
const int N = 2e5;
vector<int> ans,to[N],canoe[N],prev_all;
deque<pair<int,int>> cycle,prev_cycle;
bitset<N> vu,vu3,path,prev_path,vu2;
bool impo = false, first_cycle = false;
int op1 = 0, op2 = 0, except = 0;
bool dfs2(int node){
if (path[node]){
op2 = node;
return true;
}
if (vu[node]) return false;
vu[node] = true;
path[node] = true;
for (int i=0; i<to[node].size(); ++i){
if (!vu3[canoe[node][i]] and (prev_path[canoe[node][i]] or dfs2(to[node][i]))){
if (prev_path[canoe[node][i]]){
op2 = canoe[node][i];
first_cycle = true;
}
else cycle.emplace_back(canoe[node][i],node);
return true;
}
}
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... |