Bubble Cup 13 - Finals [Online Mirror, unrated, Div. 1]

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1423 Bubble Cup 13 - Finals [Online Mirror, unrated, Div. 1] FINISHED False 10800 135449711 Oct. 5, 2020, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 144 ) C Dušan's Railway PROGRAMMING graphs trees

B"As you may already know, Du xc5 xa1an is keen on playing with railway models. He has a big map with cities that are connected with railways. His map can be seen as a graph where vertices are cities and the railways connecting them are the edges. So far, the graph corresponding to his map is a tree. As you already know, a tree is a connected acyclic undirected graph. He is curious to find out whether his railway can be optimized somehow. He wants to add so-called shortcuts, which are also railways connecting pairs of cities. This shortcut will represent the railways in the unique path in the tree between the pair of cities it connects. Since Du xc5 xa1an doesn't like repeating the railways, he has also defined good paths in his newly obtained network (notice that after adding the shortcuts, his graph is no more a tree). He calls a path good, if no edge appears more than once, either as a regular railway edge or as an edge represented by some shortcut (Every shortcut in a good path has length 1, but uses up all the edges it represents - they can't appear again in that path). Having defined good paths, he defines good distance between two cities to be the length of the shortest good path between them. Finally, the shortcutting diameter of his network is the largest good distance between any two cities. Now he is curious to find out whether it is possible to achieve shortcutting diameter less or equal than k , while adding as few shortcuts as possible. Your solution should add no more than mathbf{10 cdot n} shortcuts. The first line in the standard input contains an integer n ( 1 <= n <= 10^4 ), representing the number of the cities in Du xc5 xa1an's railway map, and an integer k ( 3 <= k <= n ) representing the shortcutting diameter that he wants to achieve. Each of the following n - 1 lines will contain two integers u_i and v_i ( 1 <= u_i, v_i <= n, u_i neq v_i ), meaning that there is a railway between cities u_i "...

Tutorials

FinalsEditorial2020.pdf

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
94805942 doraaki C Oct. 5, 2020, 8:40 p.m. OK GNU C++14 TESTS 18 77 8396800
94779726 linus123 Tzak thebes C Oct. 5, 2020, 2:32 p.m. OK GNU C++17 TESTS 18 62 2867200
94789081 tourist C Oct. 5, 2020, 3:54 p.m. OK GNU C++17 TESTS 18 62 3584000
94788146 keko37 dorijanlendvaj ppavic C Oct. 5, 2020, 3:45 p.m. OK GNU C++17 TESTS 18 62 5017600
94803176 Um_nik C Oct. 5, 2020, 7:36 p.m. OK GNU C++17 (64) TESTS 18 93 5836800

remove filters

Back to search problems