답안 #377803

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
377803 2021-03-15T07:24:42 Z autumn_eel 기지국 (IOI20_stations) C++14
5 / 100
1065 ms 1356 KB
#include "stations.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<int(n);i++)
using namespace std;
typedef long long ll;

std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
	vector<vector<int>>E(n);
	vector<int>deg(n);
	rep(i,n-1){
		E[u[i]].push_back(v[i]);
		E[v[i]].push_back(u[i]);
		deg[u[i]]++;
		deg[v[i]]++;
	}
	int s=-1;
	rep(i,n){
		if(deg[i]==1){s=i;break;}
	}
	vector<int>vs;
	vector<int>labels(n,-1);

	rep(i,n){
		vs.push_back(s);
		labels[s]=i;
		for(int u:E[s]){
			if(labels[u]==-1){
				s=u;break;
			}
		}
	}

	return labels;
}

int find_next_station(int s, int t, std::vector<int> c) {
	for(int u:c){
		if((s-u>0)==(s-t>0))return u;
	}
	return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 700 ms 776 KB Output is correct
2 Correct 484 ms 756 KB Output is correct
3 Correct 954 ms 1356 KB Output is correct
4 Correct 695 ms 868 KB Output is correct
5 Correct 685 ms 996 KB Output is correct
6 Correct 580 ms 736 KB Output is correct
7 Correct 639 ms 784 KB Output is correct
8 Correct 3 ms 868 KB Output is correct
9 Correct 5 ms 996 KB Output is correct
10 Correct 2 ms 756 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 364 KB Invalid labels (values out of range). scenario=0, k=1000, vertex=4, label=-1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 593 ms 736 KB Output is correct
2 Correct 534 ms 780 KB Output is correct
3 Correct 1065 ms 868 KB Output is correct
4 Correct 652 ms 792 KB Output is correct
5 Correct 635 ms 868 KB Output is correct
6 Correct 470 ms 756 KB Output is correct
7 Correct 423 ms 756 KB Output is correct
8 Correct 3 ms 736 KB Output is correct
9 Correct 5 ms 1012 KB Output is correct
10 Correct 2 ms 736 KB Output is correct
11 Incorrect 1 ms 364 KB Invalid labels (values out of range). scenario=1, k=1000000, vertex=3, label=-1
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 902 ms 744 KB Output is correct
2 Correct 704 ms 868 KB Output is correct
3 Correct 603 ms 1188 KB Output is correct
4 Correct 3 ms 876 KB Output is correct
5 Correct 5 ms 756 KB Output is correct
6 Correct 2 ms 796 KB Output is correct
7 Incorrect 1 ms 364 KB Invalid labels (values out of range). scenario=0, k=1000000000, vertex=2, label=-1
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 529 ms 780 KB Output is correct
2 Correct 448 ms 780 KB Output is correct
3 Correct 1031 ms 736 KB Output is correct
4 Correct 687 ms 868 KB Output is correct
5 Correct 641 ms 868 KB Output is correct
6 Correct 507 ms 736 KB Output is correct
7 Correct 537 ms 736 KB Output is correct
8 Correct 3 ms 876 KB Output is correct
9 Correct 7 ms 736 KB Output is correct
10 Correct 2 ms 868 KB Output is correct
11 Incorrect 6 ms 364 KB Invalid labels (values out of range). scenario=0, k=1000000000, vertex=4, label=-1
12 Halted 0 ms 0 KB -