# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40439 | 2018-02-01T13:05:24 Z | Pajaraja | Pipes (CEOI15_pipes) | C++14 | 517 ms | 11484 KB |
#include <bits/stdc++.h> using namespace std; vector<unsigned short> g[30007]; unsigned short d[30007]; int dfs(int s,int du,int f) { int x=10000007; d[s]=du; int cnt=0; for(int i=0;i<g[s].size();i++) { if(cnt==0 && g[s][i]==f) { cnt++; continue; } if(d[g[s][i]]==-1) { int y=dfs(g[s][i],du+1,s); if(y>du) printf("%d %d\n",s,g[s][i]); x=fmin(x,y); } else x=fmin(x,d[g[s][i]]); } return x; } int main() { int n,m; fill(d,d+10007,-1); scanf("%d%d",&n,&m); for(int i=0;i<m;i++) { int t1,t2; scanf("%d%d",&t1,&t2); g[t1].push_back(t2); g[t2].push_back(t1); } for(int i=1;i<=n;i++) if(d[i]==-1) dfs(i,0,-1); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1024 KB | Wrong number of edges |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 1152 KB | Wrong number of edges |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 139 ms | 5112 KB | Output is correct |
2 | Incorrect | 137 ms | 4876 KB | Wrong number of edges |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 260 ms | 6488 KB | Output is correct |
2 | Incorrect | 309 ms | 9200 KB | Wrong number of edges |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 517 ms | 11484 KB | Output is correct |
2 | Incorrect | 398 ms | 10444 KB | Wrong number of edges |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |