# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117688 | Plurm | Toy Train (IOI17_train) | C++14 | 181 ms | 1912 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 "train.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> g[5005];
vector<int> rg[5005];
bool found[5005];
stack<int> ord;
void dfs1(int u){
if(found[u]) return;
found[u] = true;
for(int v : g[u]){
dfs1(v);
}
ord.push(u);
}
int cc[5005];
bool gcc[5005];
void dfs2(int u, int c = 0){
if(!found[u]) return;
found[u] = false;
cc[u] = c;
for(int v : rg[u]){
dfs2(v, c);
}
}
bool dfs3(int u){
if(found[u]) return gcc[cc[u]];
found[u] = true;
for(int v : g[u]){
if(dfs3(v)) return true;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |