Submission #412972

# Submission time Handle Problem Language Result Execution time Memory
412972 2021-05-27T21:34:29 Z SuhaibSawalha1 Stations (IOI20_stations) C++17
0 / 100
5 ms 420 KB
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> adj;
vector<int> lables;
int cnt;

void dfs (int u = 0, int p = -1) {
	for (int v : adj[u]) {
		if (v ^ p) {
			dfs(v, u);
		}
	}
	lables[u] = cnt++;
}

vector<int> label(int n, int k, vector<int> u, vector<int> v) {
	adj.assign(n, {});
	lables.resize(n);
	cnt = 0;
	for (int i = 0; i < n - 1; ++i) {
		adj[u[i]].push_back(v[i]);
	}
	dfs();
	return lables;
}
 
int find_next_station(int s, int t, vector<int> c) {
	return s - (t < s) + (t > s);
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 328 KB Invalid labels (duplicates values). scenario=0, label=0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 420 KB Invalid labels (duplicates values). scenario=0, label=0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 276 KB Invalid labels (duplicates values). scenario=0, label=0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 280 KB Invalid labels (duplicates values). scenario=2, label=0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 288 KB Invalid labels (duplicates values). scenario=0, label=0
2 Halted 0 ms 0 KB -