# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
573356 |
2022-06-06T12:51:41 Z |
vladislav11 |
Pipes (CEOI15_pipes) |
C++14 |
|
1765 ms |
65536 KB |
#include <bits/stdc++.h>
using namespace std;
int n, m;
vector< vector<int> > grp;
vector<int> a, used;
void dfs ( int v, int p )
{
used[v] = 1;
for ( auto& to : grp[v] )
if ( to != p )
{
if ( used[to] )
{
a[v]++;
a[to]--;
}
else
{
dfs( to, v );
a[v] += a[to];
if ( !a[to] )
cout << "!" << v << ' ' << to << '\n';
}
}
return;
}
int main ()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
grp.assign( n+1, vector<int>() );
for ( int i=0; i<m; i++ )
{
int u, v;
cin >> u >> v;
grp[u].push_back( v );
grp[v].push_back( u );
}
a.assign( n+1, 0 );
used.assign( n+1, 0 );
for ( int i=1; i<=n; i++ )
if ( !used[i] )
dfs( i, -1 );
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Expected integer, but "!17" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
980 KB |
Expected integer, but "!3706" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
108 ms |
14016 KB |
Output is correct |
2 |
Incorrect |
110 ms |
13276 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
222 ms |
21668 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
359 ms |
39416 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
655 ms |
50220 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1068 ms |
65536 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1375 ms |
65536 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1548 ms |
65536 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1765 ms |
65536 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |