Submission #321669

# Submission time Handle Problem Language Result Execution time Memory
321669 2020-11-13T03:05:53 Z Gilgamesh Stations (IOI20_stations) C++17
Compilation error
0 ms 0 KB
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned ll;
 
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x first
#define y second
#define PI 3.14159265

const int mxN = 1'001;

vector<int> adj[mxN];
int timer;

void dfs(int v, int p, vector<int>& labels){
	labels[timer++] = v;
	for(int i : adj[v]) {
		if(i == p) continue;
		dfs(i, v, labels);
	}
}

vector<int> label(int n, int k, vector<int> u, svector<int> v) {
	vector<int> labels(n);
	for(int i = 0; i < n - 1; ++i){
		adj[u[i]].eb(adj[v[i]]);
		adj[v[i]].eb(adj[u[i]]);
	}
	timer = 0;
	dfs(0, -1, labels);
	return labels;
}

int find_next_station(int s, int t, vector<int> c) {
	sort(all(c));
	if(t < s) {
		return c[0];
	} else {
		int ans = 0;
		for(int i : c){
			if(t < i) break;
			ans = i;
		}
		return ans;
	}
}

//int main(){}

Compilation message

stations.cpp:31:48: error: 'svector' has not been declared
   31 | vector<int> label(int n, int k, vector<int> u, svector<int> v) {
      |                                                ^~~~~~~
stations.cpp:31:55: error: expected ',' or '...' before '<' token
   31 | vector<int> label(int n, int k, vector<int> u, svector<int> v) {
      |                                                       ^
stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, int)':
stations.cpp:34:20: error: 'v' was not declared in this scope
   34 |   adj[u[i]].eb(adj[v[i]]);
      |                    ^