Submission #826397

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8263972023-08-15 14:16:39alvingogoThousands Islands (IOI22_islands)C++17
10.15 / 100
34 ms6968 KiB
#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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...