Submission #244514

# Submission time Handle Problem Language Result Execution time Memory
244514 2020-07-04T08:34:30 Z dantoh000 Pipes (CEOI15_pipes) C++14
Compilation error
0 ms 0 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);
        }
    }
}

Compilation message

pipes.cpp: In function 'int main()':
pipes.cpp:44:18: error: too few arguments to function 'void dfs(int, int)'
             dfs(i);
                  ^
pipes.cpp:10:6: note: declared here
 void dfs(int u, int p){
      ^~~
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);
         ~~~~~^~~~~~~~~~~~~~