# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
244453 | 2020-07-04T06:21:44 Z | dantoh000 | Pipes (CEOI15_pipes) | C++14 | 1436 ms | 65540 KB |
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; int n,m; vector<int> G[100005]; int num[100005]; int p[100005]; int low[100005]; int ct = 1; int root; map< ii , int> M; void dfs(int u){ low[u] = num[u] = ct++; for (auto v : G[u]){ if (num[v] == 0){ p[v] = u; dfs(v); if (low[v] > num[u]){ if (M[ii(min(u,v),max(u,v))] == 1){ printf("%d %d\n",u,v); } } low[u] = min(low[u],low[v]); } else if (v != p[u]){ low[u] = min(low[u],num[v]); } } } int main(){ scanf("%d%d",&n,&m); for (int i = 0; i < m; i++){ int u,v; scanf("%d%d",&u,&v); if (u > v) swap(u,v); G[u].push_back(v); G[v].push_back(u); M[ii(u,v)]++; } for (int i = 1; i <= n; i++){ if (num[i] == 0){ dfs(i); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 3968 KB | Output is correct |
2 | Correct | 14 ms | 3712 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 990 ms | 46284 KB | Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1306 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1355 ms | 65536 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1420 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1382 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1406 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1427 ms | 65536 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1436 ms | 65536 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |