# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
367092 |
2021-02-16T08:53:40 Z |
duchung |
Pipes (CEOI15_pipes) |
C++17 |
|
2352 ms |
65540 KB |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n , m;
vector<int> edge[N];
int low[N] , tin[N];
bool visited[N];
int timer = 0;
void dfs(int u , int p)
{
low[u] = tin[u] = ++timer;
visited[u] = true;
for (auto v : edge[u])
{
if (p == v) continue;
if (visited[v])
{
low[u] = min(low[u] , tin[v]);
}
else
{
dfs(v , u);
low[u] = min(low[u] , low[v]);
if (low[v] > tin[u])
{
cout << u << " " << v << "\n";
}
}
}
}
int main()
{
// freopen(".inp","r",stdin);
// freopen(".out","w",stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
while(m--)
{
int u , v;
cin >> u >> v;
edge[u].push_back(v);
edge[v].push_back(u);
}
for (int i = 1 ; i <= n ; ++i)
{
if (!visited[i])
{
dfs(i , -1);
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2668 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2668 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
3308 KB |
Output is correct |
2 |
Incorrect |
5 ms |
3052 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
16364 KB |
Output is correct |
2 |
Correct |
138 ms |
15828 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
246 ms |
23916 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
541 ms |
41324 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
849 ms |
51128 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1319 ms |
62376 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1685 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2097 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2352 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |