# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
34380 | 2017-11-10T19:33:56 Z | mohammad_kilani | Pipes (CEOI15_pipes) | C++14 | 698 ms | 23368 KB |
#include <bits/stdc++.h> using namespace std; #define mod 1000007 #define oo 2000000000 const int M = 1500010 , N = 30011; bitset< N > vis; vector< int > g[N]; int dfs_low[N], dfs_num[N], num = 0 ; int n , m , u , v; void DFS(int node,int prnt){ vis[node] = true; dfs_low[node] = dfs_num[node] = num++; for(int i=0;i<g[node].size();i++){ if(g[node][i] == prnt) continue; if(vis[g[node][i]]){ dfs_low[node] = min(dfs_low[node],dfs_num[g[node][i]]); } else{ DFS(g[node][i],node); if(dfs_num[node] < dfs_low[g[node][i]]){ printf("%d %d\n",node,g[node][i]); } dfs_low[node] = min(dfs_low[node],dfs_low[g[node][i]]); } } } int main() { //freopen("in.txt","r",stdin); scanf("%d%d",&n,&m); for(int i=0;i<m;i++){ scanf("%d%d",&u,&v); g[u].push_back(v); g[v].push_back(u); } for(int i=1;i<=n;i++){ if(vis[i] == false) DFS(i,-1); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1024 KB | Output is correct |
2 | Incorrect | 3 ms | 1024 KB | Wrong number of edges |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 1536 KB | Output is correct |
2 | Incorrect | 6 ms | 1280 KB | Wrong number of edges |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 158 ms | 9084 KB | Output is correct |
2 | Correct | 159 ms | 8512 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 324 ms | 12492 KB | Output is correct |
2 | Runtime error | 413 ms | 17036 KB | Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 698 ms | 23368 KB | Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1792 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1792 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1792 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1792 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1920 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |