# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
527167 |
2022-02-17T03:06:55 Z |
joelau |
Pipes (CEOI15_pipes) |
C++14 |
|
1719 ms |
65540 KB |
#include <bits/stdc++.h>
using namespace std;
int N,M, num[100005], low[100005], p[100005], cnt = 0;
vector<int> lst[100005];
void dfs (int u) {
low[u] = num[u] = cnt++;
for (int v: lst[u]) {
if (num[v] == -1) {
p[v] = u;
dfs(v);
if (low[v] > num[u])
cout << u+1 << ' ' << v+1 << '\n';
low[u] = min(low[u],low[v]);
}
else if (v != p[u])
low[u] = min(low[u],num[v]);
}
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin >> N >> M;
for (int i = 0; i < M; ++i) {
int u,v; cin>> u >> v; u--, v--;
lst[u].push_back(v), lst[v].push_back(u);
}
memset(num,-1,sizeof(num));
for (int i = 0; i < N; ++i) if (num[i] == -1) dfs(i);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3020 KB |
Output is correct |
2 |
Incorrect |
2 ms |
3020 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
3660 KB |
Output is correct |
2 |
Incorrect |
5 ms |
3404 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
121 ms |
13564 KB |
Output is correct |
2 |
Correct |
106 ms |
12868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
191 ms |
17152 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
411 ms |
28840 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
547 ms |
33424 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
927 ms |
55528 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1311 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1609 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1719 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |