# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
633107 | anhduc2701 | Pipes (BOI13_pipes) | C++17 | 137 ms | 18488 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<bits/stdc++.h>
using namespace std;
int n,m;
long long a[100005],par[100005],H[100005],ans[100005];
bool vis[100005];
long long c[2];
vector<pair<int,int>>Edge;
vector<pair<int,int>>G[100005];
void DFS(int u,int p=-1){
for(auto v:G[u]){
if(v.first==p)continue;
if(H[v.first]!=-1){
if((H[u]-H[v.first])%2==1){
cout<<0;
exit(0);
}
}
else{
H[v.first]=H[u]+1;
DFS(v.first,u);
}
}
}
void DFS2(int u,int p=-1){
vis[u]=1;
for(auto v:G[u]){
if(vis[v.first])continue;
DFS2(v.first,u);
ans[v.second]=a[v.first];
a[u]-=a[v.first];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |