# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
585654 | 2022-06-29T07:42:06 Z | 1zaid1 | Pipes (CEOI15_pipes) | C++14 | 1742 ms | 65536 KB |
#include <bits/stdc++.h> using namespace std; #define endl '\n' const int M = 1e5+1; vector<int> node[M]; int a[M], tt = 1; bitset<100005> vis; void dfs(int s, int p = 1) { a[s] = tt++; vis[s] = true; for (int i:node[s]) { if (!vis[i]) { dfs(i, s); if (a[i] > a[s]) cout << s << ' ' << i << endl; } } for (int i:node[s]) if (i != p) a[s] = min(a[s], a[i]); } signed main() { cin.tie(0)->sync_with_stdio(0); int n, m; cin >> n >> m; for (int i = 1; i <= m; i++) { int a, b; cin >> a >> b; node[a].push_back(b); node[b].push_back(a); } for (int i = 1; i <= n; i++) if (!vis[i]) dfs(i); vis = 0; return 0; } /* 10 11 1 7 1 8 1 6 2 8 6 7 5 8 2 5 2 3 2 4 3 4 10 9 */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2644 KB | Output is correct |
2 | Incorrect | 1 ms | 2644 KB | Wrong number of edges |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 3156 KB | Output is correct |
2 | Incorrect | 4 ms | 2900 KB | Wrong number of edges |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 124 ms | 11500 KB | Output is correct |
2 | Correct | 108 ms | 10596 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 192 ms | 14960 KB | Output is correct |
2 | Runtime error | 224 ms | 18940 KB | Memory limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 383 ms | 26028 KB | Memory limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 630 ms | 32324 KB | Memory limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1039 ms | 65220 KB | Memory limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1270 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1730 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1742 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |