# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
244455 | 2020-07-04T06:27:14 Z | dantoh000 | Pipes (CEOI15_pipes) | C++14 | 1256 ms | 65540 KB |
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; typedef pair<int,int> ii; int n,m; vector<int> G[100005]; int num[100005]; int p[100005]; int low[100005]; int ct = 1; int k[100005]; unordered_map<int,int> M; int hsh(int u, int v){ return (k[u]+k[v])%mod; } int root; void dfs(int u){ low[u] = num[u] = ct++; for (auto v : G[u]){ if (num[v] == 0){ p[v] = u; dfs(v); if (low[v] > num[u]){ if (M[hsh(u,v)] == 1){ printf("%d %d\n",u,v); } } low[u] = min(low[u],low[v]); } else if (v != p[u]){ low[u] = min(low[u],num[v]); } } } int main(){ scanf("%d%d",&n,&m); k[0] = 1; for (int i = 1; i <= n; i++){ k[i] = (k[i-1]*3)%1000000007; } for (int i = 0; i < m; i++){ int u,v; scanf("%d%d",&u,&v); if (u > v) swap(u,v); G[u].push_back(v); G[v].push_back(u); M[hsh(u,v)]++; } for (int i = 1; i <= n; i++){ if (num[i] == 0){ dfs(i); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 3712 KB | Output is correct |
2 | Correct | 12 ms | 3456 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 552 ms | 35304 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 | 1083 ms | 62768 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 | 1039 ms | 65536 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1256 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1217 ms | 65536 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 969 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 969 ms | 65536 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1030 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |