# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826397 | alvingogo | Thousands Islands (IOI22_islands) | C++17 | 34 ms | 6968 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>
#define fs first
#define sc second
using namespace std;
vector<vector<pair<int,int> > > e;
vector<int> dep,fa;
vector<int> ss;
vector<int> ans;
int dfs(int r,int f){
dep[r]=dep[f]+1;
fa[r]=f;
for(auto h:e[r]){
if(ss[h.sc/2]){
continue;
}
ss[h.sc/2]=1;
if(dep[h.fs]==-1){
if(dfs(h.fs,r)){
return 1;
}
}
else if(dep[h.fs]>=0){
vector<int> bz;
for(int i=0;i!=h.fs;){
for(auto w:e[i]){
if(dep[w.fs]==dep[i]+1){
bz.push_back(w.sc);
# | 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... |