Submission #1311222

#TimeUsernameProblemLanguageResultExecution timeMemory
1311222al_reem_2010Stations (IOI20_stations)C++20
Compilation error
0 ms0 KiB
// اَللَهُمَ صَلِ عَلَىَ مُحَمَدٍ وَ آلِ مُحَمَدٍ
#include "bits/stdc++.h"
#include "stations"
using namespace std ;
//#define int long long
#define pb push_back
#define si size()
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define applejuice ios::sync_with_stdio(false) ; cin.tie(nullptr) ; cout.tie(nullptr) ;
//const int inf=1e18 ;
const int mod=1e9+7 ;
const int maxn=1e5+7 ;
int tt=1 ;
vector<int> l[maxn] ;
int u[maxn] , pp[maxn] ;
void dfs(int k , int p)
{
    u[k]=1 ;
    pp[k]=p ;
    for(int i=0 ; i<l[k].si ; i++)
    {
        if(u[l[k][i]]) {continue ;}
        dfs(l[k][i],p+1) ;
    }
    return ;
}
vector<int> label(int n , vector<int> u , vector<int> v)
{
    for(int i=0 ; i<n ; i++) {l[u[i]].pb(v[i]) ; l[v[i]].pb(u[i]) ;}
    for(int i=1 ; i<=n ; i++) {if(l[i].si==1) {dfs(i,0) ; break ;}}
    vector<int> a ;
    for(int i=1 ; i<=n ; i++) {a.pb(pp[i]) ;}
    return a ;
}
int find_next_station(int s , int t , vector<int> c)
{
    if(t<s) {return c[0] ;}
    return c.back() ;
    
}
/*
void solve()
{
}
signed main()
{
    //wrong
    applejuice ;
    //cin >> tt ;
    while(tt--) {solve() ;}
}
*/



Compilation message (stderr)

/usr/bin/ld: /tmp/ccDZTPBf.o: in function `main':
stub.cpp:(.text.startup+0x2b4): undefined reference to `label(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status