Submission #372957

# Submission time Handle Problem Language Result Execution time Memory
372957 2021-03-02T13:36:35 Z Jarif_Rahman Stations (IOI20_stations) C++17
0 / 100
998 ms 980 KB
#include "stations.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
vector<vector<int>> v;
vector<int> order;
void dfs(int nd, int ss){
    order.pb(nd);
    for(int x: v[nd]) if(x != ss) dfs(x, nd);
}
vector<int> label(int n, int k, vector<int> aa, vector<int> bb){
    v.assign(n, {});
    order.clear();
    for(int i = 0; i < n-1; i++){
        v[aa[i]].pb(bb[i]);
        v[bb[i]].pb(aa[i]);
    }
    for(int i = 0; i < n; i++){
        dfs(i, -1);
        break;
    }
    vector<int> lb(n);
    for(int i = 0; i < n; i++) lb[order[i]] = i;
    return lb;
}
int find_next_station(int s, int t, vector<int> c){
    if(s < t) return s+1;
    return s-1;
}
# Verdict Execution time Memory Grader output
1 Incorrect 557 ms 980 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 482 ms 884 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 592 ms 964 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 998 ms 756 KB Output is correct
2 Incorrect 754 ms 736 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 633 ms 876 KB Wrong query response.
2 Halted 0 ms 0 KB -