Submission #1080256

# Submission time Handle Problem Language Result Execution time Memory
1080256 2024-08-29T08:23:28 Z Sir_Ahmed_Imran Stations (IOI20_stations) C++17
0 / 100
1 ms 344 KB
                            ///~~~LOTA~~~///
//#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define terminator main
#define N 1000
int m;
int e[N];
vector<int> l;
vector<int> a[N];
void dfs(int v,int u){
    l[v]=m;
    cout<<v<<' '<<m<<nl;
    m++;
    for(auto& i:a[v])
        if(i!=u) dfs(i,v);
}
vector<int> label(int n,int k,vector<int> u,vector<int> v){
    l.clear();
    for(int i=m=0;i<n;i++){
        a[i].clear();
        l.append(0);
        e[i]=0;
    }
    for(int i=0;i<n-1;i++){
        a[v[i]].append(u[i]);
        a[u[i]].append(v[i]);
        e[v[i]]++;
        e[u[i]]++;
    }
    for(int i=0;i<n;i++){
        if(e[i]>1) continue;
        dfs(i,-1);
        break;
    }
    return(l);
}
int find_next_station(int s,int t,vector<int> c){
    return s-(s>t)+(t>s);
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -