# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34461 | 2017-11-11T13:49:50 Z | bnahmad15 | Pipes (CEOI15_pipes) | C++14 | 607 ms | 13364 KB |
#include <bits/stdc++.h> using namespace std; const int N = 30003; bitset< N > vis; vector< short > adj[N]; short dfs_low[N], dfs_num[N], num = 0 ; int n , m , u , v , ans = 0 ; void DFS(short node,short prnt){ vis[node]=true; dfs_low[node]=dfs_num[node]=num++; for (short i = 0;i<adj[node].size();i++){ if (adj[node][i]==prnt) continue; if (vis[adj[node][i]]){ dfs_low[node]=min(dfs_low[node],dfs_num[adj[node][i]]); } else { DFS(adj[node][i],node); if (dfs_num[node] < dfs_low[adj[node][i]]){ printf("%d %d\n",node,adj[node][i]); } dfs_low[node]=min(dfs_low[node],dfs_low[adj[node][i]]); } } } int main(){ scanf("%d%d",&n,&m); for (int i = 0 ; i <m;i++){ scanf("%d%d",&u,&v); adj[u].push_back(v); adj[v].push_back(u); } for (int i = 1 ; i <= n;i++) if (!vis[i]) DFS(i,-1); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 1024 KB | Output is correct |
2 | Incorrect | 2 ms | 1024 KB | Wrong number of edges |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 1408 KB | Output is correct |
2 | Incorrect | 6 ms | 1152 KB | Wrong number of edges |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 151 ms | 5196 KB | Output is correct |
2 | Correct | 149 ms | 4824 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 294 ms | 7264 KB | Output is correct |
2 | Correct | 355 ms | 9136 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 607 ms | 13364 KB | Output is correct |
2 | Correct | 452 ms | 11640 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1792 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 | 1792 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 | 1792 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |