답안 #244515

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
244515 2020-07-04T08:34:55 Z dantoh000 Pipes (CEOI15_pipes) C++14
30 / 100
633 ms 23104 KB
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
int n,m;
bitset<10005> M[10005];
bitset<10005> G[10005];
int num[10005];
int low[10005];
int ct = 1;
void dfs(int u, int p){
    low[u] = num[u] = ct++;
    for (int v = 1; v <= n; v++){
        if (G[min(u,v)][max(u,v)]){
            if (num[v] == 0){
                dfs(v,u);
                if (low[v] > num[u]){
                    if (M[min(u,v)][max(u,v)] == 0){
                        printf("%d %d\n",u,v);
                    }
                }
                low[u] = min(low[u],low[v]);
            }
            else if (v != p){
                low[u] = min(low[u],num[v]);
            }
        }
    }
}
int main(){
    scanf("%d%d",&n,&m);
    for (int i = 0; i < m; i++){
        int u,v;
        scanf("%d%d",&u,&v);
        if (u > v) swap(u,v);
        if (G[u][v]){
            M[u][v] = 1;
        }
        else{
            G[u][v] = 1;
        }
    }
    for (int i = 1; i <= n; i++){
        if (num[i] == 0){
            dfs(i,-1);
        }
    }
}

Compilation message

pipes.cpp: In function 'int main()':
pipes.cpp:30:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
pipes.cpp:33:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&u,&v);
         ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 512 KB Output is correct
2 Correct 5 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 68 ms 5760 KB Output is correct
2 Correct 62 ms 5680 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 203 ms 9184 KB Output is correct
2 Correct 197 ms 8696 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 633 ms 23104 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 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 8 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -