# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
199450 | TadijaSebez | Pipes (BOI13_pipes) | C++11 | 1065 ms | 80608 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int N=100050;
const int M=500050;
int deg[N];
ll c[N],ans[M];
vector<pair<int,int>> E[N];
bool was[N],vis[N],cyc[N];
int dep[N],mnd[N],par[N];
void No(){printf("0\n");exit(0);}
void DFS(int u,int p=0){
vis[u]=1;
for(auto e:E[u]){
int v=e.first;
if(!vis[v]){
dep[v]=dep[u]+1;
par[v]=u;
DFS(v,u);
}else if(dep[v]<dep[u] && v!=p){
//printf("%i %i %i\n",dep[u]-dep[v],u,v);
if((dep[u]-dep[v])%2==1)No();
for(int w=u;w!=v;w=par[w]){
if(cyc[w])No();
cyc[w]=1;
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |