# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1135187 | emptypringlescan | KOVANICE (COI15_kovanice) | C++17 | 208 ms | 33044 KiB |
#include <bits/stdc++.h>
using namespace std;
int par[300005];
vector<int> adj[2][300005];
int val[2][300005];
int n,m,v;
int find(int x){
if(par[x]==x) return x;
return par[x]=find(par[x]);
}
void merge(int x, int y){
x=find(x); y=find(y);
par[x]=y;
}
void forward(int x){
if(val[0][x]) return;
val[0][x]=n;
for(int i:adj[0][x]){
forward(i);
val[0][x]=min(val[0][x],val[0][i]-1);
}
}
void backward(int x){
if(val[1][x]) return;
val[1][x]=1;
for(int i:adj[1][x]){
backward(i);
val[1][x]=max(val[1][x],val[1][i]+1);
}
}
# | 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... |