Submission #839589

# Submission time Handle Problem Language Result Execution time Memory
839589 2023-08-30T10:01:48 Z kyaruru Pipes (CEOI15_pipes) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int, int> pii;typedef pair<ll, ll> pll;vector<int> adj[100001];vector<int> tin(100001,-1),low(100001,-1);vector<pii> ans;bool vi[100001];int t=0;void dfs(int x,int p=-1){    vi[x]=true;    tin[x]=low[x]=t++;    for(int u:adj[x]){        if(u==p) continue;        if(vi[u]){            low[x]=min(low[x],tin[u]);        }else{            dfs(u,x);            low[x]=min(low[x],low[u]);            if(low[u]>tin[x]) ans.push_back({min(u,x),max(u,x)});        }    }}int main() {    ios::sync_with_stdio(0);    cin.tie(0);    int a,b;    cin>>a>>b;    for(int i=0; i<b; i++){        int x,y;        cin>>x>>y;        adj[x].push_back(y);        adj[y].push_back(x);    }    for(int i=1; i<=a; i++){        if(!vi[i]) dfs(i);    }    sort(ans.begin(), ans.end());    cout<<ans.size()<<"\n";    for(pii u:ans) cout<<u.first<<" "<<u.second<<"\n";}

Compilation message

pipes.cpp:1:31: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int, int> pii;typedef pair<ll, ll> pll;vector<int> adj[100001];vector<int> tin(100001,-1),low(100001,-1);vector<pii> ans;bool vi[100001];int t=0;void dfs(int x,int p=-1){    vi[x]=true;    tin[x]=low[x]=t++;    for(int u:adj[x]){        if(u==p) continue;        if(vi[u]){            low[x]=min(low[x],tin[u]);        }else{            dfs(u,x);            low[x]=min(low[x],low[u]);            if(low[u]>tin[x]) ans.push_back({min(u,x),max(u,x)});        }    }}int main() {    ios::sync_with_stdio(0);    cin.tie(0);    int a,b;    cin>>a>>b;    for(int i=0; i<b; i++){        int x,y;        cin>>x>>y;        adj[x].push_back(y);        adj[y].push_back(x);    }    for(int i=1; i<=a; i++){        if(!vi[i]) dfs(i);    }    sort(ans.begin(), ans.end());    cout<<ans.size()<<"\n";    for(pii u:ans) cout<<u.first<<" "<<u.second<<"\n";}
      |                               ^~~~~~~~~
pipes.cpp:1:10: fatal error: bits/stdc++.h>usin: No such file or directory
    1 | #include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int, int> pii;typedef pair<ll, ll> pll;vector<int> adj[100001];vector<int> tin(100001,-1),low(100001,-1);vector<pii> ans;bool vi[100001];int t=0;void dfs(int x,int p=-1){    vi[x]=true;    tin[x]=low[x]=t++;    for(int u:adj[x]){        if(u==p) continue;        if(vi[u]){            low[x]=min(low[x],tin[u]);        }else{            dfs(u,x);            low[x]=min(low[x],low[u]);            if(low[u]>tin[x]) ans.push_back({min(u,x),max(u,x)});        }    }}int main() {    ios::sync_with_stdio(0);    cin.tie(0);    int a,b;    cin>>a>>b;    for(int i=0; i<b; i++){        int x,y;        cin>>x>>y;        adj[x].push_back(y);        adj[y].push_back(x);    }    for(int i=1; i<=a; i++){        if(!vi[i]) dfs(i);    }    sort(ans.begin(), ans.end());    cout<<ans.size()<<"\n";    for(pii u:ans) cout<<u.first<<" "<<u.second<<"\n";}
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.