Submission #432784

# Submission time Handle Problem Language Result Execution time Memory
432784 2021-06-18T13:21:13 Z A_D Stations (IOI20_stations) C++14
0 / 100
891 ms 656 KB
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> ret;
vector<vector<int>> g;
int timer;
void dfs(int u,int p)
{
    ret.push_back(timer++);
    for(auto x:g[u]){
        if(x==p)continue;
        dfs(x,u);
    }
}
vector<int> label(int n, int k,vector<int> u,vector<int> v){
    timer=0;
    g.clear();
    ret.clear();
    g.resize(n);
    for(int i=0;i<n-1;i++){
        g[u[i]].push_back(v[i]);
        g[v[i]].push_back(u[i]);
    }
    for(int i=0;i<n;i++){
        if(g[i].size()==1){
            dfs(i,i);
            break;
        }
    }
    return ret;
}

int find_next_station(int s, int t,vector<int> c){
    int mx=0,mn=1e9;
    for(auto x:c){
        mn=min(mn,x);
        mx=max(mx,x);
    }
    if(s<t)return mx;
    else return mn;
}
# Verdict Execution time Memory Grader output
1 Incorrect 541 ms 640 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 471 ms 576 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 533 ms 604 KB Wrong query response.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 891 ms 484 KB Output is correct
2 Incorrect 681 ms 400 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 545 ms 656 KB Wrong query response.
2 Halted 0 ms 0 KB -