Submission #250118

# Submission time Handle Problem Language Result Execution time Memory
250118 2020-07-17T04:06:25 Z rrrr10000 Duathlon (APIO18_duathlon) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=k;i<(ll)(n);i++)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) v.begin(),v.end()
const ll inf=1001001001001001;
const int mod=998244353;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<endl;}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}

vvp g;
vb used;
vi cnt;
ll sz,ans=0;
void scan(int i){
    used[i]=true;
    sz++;
    for(auto x:g[i])if(!used[x.fi])scan(x.fi);
}
vi lk,ge;
ll c,ce,cv;
vb k;
void dfs(int i,int p,int e){
    vp dl;
    for(auto x:g[i])if(x.fi!=p){
        if(id[x.fi]==-1){
            id[x.fi]=c++;
            dfs(x.fi,i,x.se);
            if(p!=-1){
                if(lk[x.fi]>=id[i])k[i]=true;
            }
            dl.pb(x);
        }
        else chmin(lk[i],id[x.fi]);
    }
    for(auto x:dl){
        if(k){
            if(lk[x.fi]>=id[i])ge[x.se]=ce++;
            else ge[x.se]=
        }
    }
}
int main(){
    ll n,m;cin>>n>>m;
    g=vvp(n);
    cnt=vi(n,1);
    used=vb(n,false);
    rep(i,m){
        ll a,b;cin>>a>>b;a--;b--;
        g[a].pb(b,i);g[b].pb(a,i);
    }
    rep(i,n){
        if(used[i])continue;
        sz=0;
        scan(i);
        // out(sz);
        id[i]=0;
        c=1;
        dfs(i,-1,-1);
    }
    out(ans);
}

Compilation message

count_triplets.cpp:24:1: error: 'vvp' does not name a type; did you mean 'vvi'?
 vvp g;
 ^~~
 vvi
count_triplets.cpp:25:1: error: 'vb' does not name a type; did you mean 'vi'?
 vb used;
 ^~
 vi
count_triplets.cpp: In function 'void scan(int)':
count_triplets.cpp:29:5: error: 'used' was not declared in this scope
     used[i]=true;
     ^~~~
count_triplets.cpp:29:5: note: suggested alternative: 'se'
     used[i]=true;
     ^~~~
     se
count_triplets.cpp:31:16: error: 'g' was not declared in this scope
     for(auto x:g[i])if(!used[x.fi])scan(x.fi);
                ^
count_triplets.cpp: At global scope:
count_triplets.cpp:35:1: error: 'vb' does not name a type; did you mean 'vi'?
 vb k;
 ^~
 vi
count_triplets.cpp: In function 'void dfs(int, int, int)':
count_triplets.cpp:37:5: error: 'vp' was not declared in this scope
     vp dl;
     ^~
count_triplets.cpp:37:5: note: suggested alternative: 'p'
     vp dl;
     ^~
     p
count_triplets.cpp:38:16: error: 'g' was not declared in this scope
     for(auto x:g[i])if(x.fi!=p){
                ^
count_triplets.cpp:39:12: error: 'id' was not declared in this scope
         if(id[x.fi]==-1){
            ^~
count_triplets.cpp:39:12: note: suggested alternative: 'i'
         if(id[x.fi]==-1){
            ^~
            i
count_triplets.cpp:43:36: error: 'k' was not declared in this scope
                 if(lk[x.fi]>=id[i])k[i]=true;
                                    ^
count_triplets.cpp:45:13: error: 'dl' was not declared in this scope
             dl.pb(x);
             ^~
count_triplets.cpp:45:13: note: suggested alternative: 'll'
             dl.pb(x);
             ^~
             ll
count_triplets.cpp:49:16: error: 'dl' was not declared in this scope
     for(auto x:dl){
                ^~
count_triplets.cpp:49:16: note: suggested alternative: 'll'
     for(auto x:dl){
                ^~
                ll
count_triplets.cpp:50:12: error: 'k' was not declared in this scope
         if(k){
            ^
count_triplets.cpp:51:26: error: 'id' was not declared in this scope
             if(lk[x.fi]>=id[i])ge[x.se]=ce++;
                          ^~
count_triplets.cpp:51:26: note: suggested alternative: 'i'
             if(lk[x.fi]>=id[i])ge[x.se]=ce++;
                          ^~
                          i
count_triplets.cpp:53:9: error: expected primary-expression before '}' token
         }
         ^
count_triplets.cpp: In function 'int main()':
count_triplets.cpp:58:5: error: 'g' was not declared in this scope
     g=vvp(n);
     ^
count_triplets.cpp:58:7: error: 'vvp' was not declared in this scope
     g=vvp(n);
       ^~~
count_triplets.cpp:58:7: note: suggested alternative: 'vvi'
     g=vvp(n);
       ^~~
       vvi
count_triplets.cpp:60:5: error: 'used' was not declared in this scope
     used=vb(n,false);
     ^~~~
count_triplets.cpp:60:5: note: suggested alternative: 'se'
     used=vb(n,false);
     ^~~~
     se
count_triplets.cpp:60:10: error: 'vb' was not declared in this scope
     used=vb(n,false);
          ^~
count_triplets.cpp:60:10: note: suggested alternative: 'vi'
     used=vb(n,false);
          ^~
          vi
count_triplets.cpp:70:9: error: 'id' was not declared in this scope
         id[i]=0;
         ^~
count_triplets.cpp:70:9: note: suggested alternative: 'i'
         id[i]=0;
         ^~
         i