Submission #308561

# Submission time Handle Problem Language Result Execution time Memory
308561 2020-10-01T14:34:01 Z Peacher29 Stations (IOI20_stations) C++14
0 / 100
1087 ms 984 KB
#include "stations.h"
#include <bits/stdc++.h>

using namespace std;

class pont{
public:
	vector<int> v;
	int be, ki;
	bool volt = 0;
	void dfs();
};

vector<pont> p;

int dd = -1;

void pont::dfs(){
	if(!volt){
		volt=1;
		be=++dd;
		for(int i : v){
			p[i].dfs();
		}
		ki=++dd;
	}
}

vector<int> label(int n, int k, vector<int> u, vector<int> v) {
	dd=-1;
	p.clear();
	p.resize(n);
	for(int i=0;i<n-1;i++){
		p[u[i]].v.push_back(v[i]);
		p[v[i]].v.push_back(u[i]);
	}
	p[0].dfs();
	vector<int> er(n);
	for(int i=0;i<n;i++){
		er[i] = p[i].be*2000+p[i].ki;
	}
	return er;
}

bool contains(int mi, int mit){
	return mi/2000 <= mit/2000 && mit%2000 <= mi%2000;
}

int find_next_station(int s, int t, vector<int> c) {
	if(contains(s,t)){
		for(int i : c){
			if(contains(i,t)){
				return i;
			}
		}
		exit(255);
	} else {
		sort(c.begin(),c.end());
		return c[0];
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 512 KB Invalid labels (values out of range). scenario=0, k=1000, vertex=1, label=14014
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 508 KB Invalid labels (values out of range). scenario=0, k=1000, vertex=0, label=1991
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 512 KB Invalid labels (values out of range). scenario=1, k=1000000, vertex=3, label=1157149
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1087 ms 760 KB Output is correct
2 Incorrect 890 ms 640 KB Wrong query response.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 661 ms 984 KB Wrong query response.
2 Halted 0 ms 0 KB -