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 |
| 526
|
ZeptoLab Code Rush 2015 |
FINISHED |
False |
9000 |
348240323 |
April 4, 2015, 4:35 p.m. |
Problems
Spiders are Om Nom's old enemies. They love eating candies as much as he does and that's why they keep trying to keep the monster away from his favorite candies. They came up with an evil plan to trap Om Nom. Let's consider a rope structure consisting of n nodes and n - 1 ropes connecting the nodes. The structure is connected, thus, the ropes and the nodes form a tree. Each rope of the formed structure is associated with its length. A candy is tied to node x of the structure. Om Nom really wants to eat this candy. The y spiders are trying to stop him from doing it. They decided to entangle the candy and some part of the structure into a web, thus attaching the candy to as large as possible part of the rope structure. Each spider can use his web to cover all ropes on the path between two arbitrary nodes a and b . Thus, y spiders can cover the set of ropes which is a union of y paths in the given tree. These y paths can arbitrarily intersect each other. The spiders want the following conditions to be hold: the node containing the candy is adjacent to at least one rope covered with a web the ropes covered with the web form a connected structure (what's the idea of covering with a web the ropes that are not connected with the candy?) the total length of the ropes covered with web is as large as possible The spiders haven't yet decided to what node of the structure they will tie the candy and how many spiders will cover the structure with web, so they asked you to help them. Help them calculate the optimal plan for multiple values of x and y . The first line contains numbers n and q ( 1 ≤ n , q ≤ 10 5 ) — the number of nodes in the structure and the number of questions that the spiders want to ask you. The next n - 1 lines determine the rope structure. The i -th line contains three integers u i , v i , l i ( 1 ≤ u i , v i ≤ n , u i ≠ v i , 1 ≤ l i ≤ 1000 ), showing that there is a rope of length l i between nodes u i and v i . Next q lines describe the spiders' |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
29588286 |
lyx_cjz |
G |
Aug. 19, 2017, 4:47 a.m. |
OK |
GNU C++ |
TESTS |
45 |
62 |
19251200 |
|
3300 |
|
29591554 |
lyx_cjz |
G |
Aug. 19, 2017, 7:27 a.m. |
OK |
GNU C++ |
TESTS |
45 |
77 |
19251200 |
|
3300 |
|
20373810 |
LIN452 |
G |
Sept. 4, 2016, 3:06 a.m. |
OK |
GNU C++ |
TESTS |
45 |
78 |
9216000 |
|
3300 |
|
20373630 |
LIN452 |
G |
Sept. 4, 2016, 2:50 a.m. |
OK |
GNU C++ |
TESTS |
45 |
78 |
9216000 |
|
3300 |
|
20373432 |
LIN452 |
G |
Sept. 4, 2016, 2:33 a.m. |
OK |
GNU C++ |
TESTS |
45 |
78 |
9318400 |
|
3300 |
|
40986846 |
ReaLNero1 |
G |
July 30, 2018, 8:47 p.m. |
OK |
GNU C++ |
TESTS |
45 |
93 |
19251200 |
|
3300 |
|
25078232 |
wzf2000 |
G |
Feb. 27, 2017, 1:18 p.m. |
OK |
GNU C++ |
TESTS |
45 |
124 |
8908800 |
|
3300 |
|
25097923 |
wanglichao1121 |
G |
Feb. 28, 2017, 10:34 a.m. |
OK |
GNU C++ |
TESTS |
45 |
139 |
9728000 |
|
3300 |
|
25070888 |
miaom |
G |
Feb. 27, 2017, 7:20 a.m. |
OK |
GNU C++ |
TESTS |
45 |
140 |
9011200 |
|
3300 |
|
33883552 |
qiqi20021026 |
G |
Jan. 3, 2018, 11:27 a.m. |
OK |
GNU C++ |
TESTS |
45 |
140 |
18534400 |
|
3300 |
|
36267801 |
_ChenKerui |
G |
March 14, 2018, 7:41 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
78 |
31846400 |
|
3300 |
|
66294634 |
yasugongshang |
G |
Dec. 5, 2019, 3:05 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
108 |
14438400 |
|
3300 |
|
51125463 |
was_n |
G |
March 10, 2019, 11:24 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
108 |
63078400 |
|
3300 |
|
38988405 |
bestFy |
G |
June 6, 2018, 8:33 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
109 |
7270400 |
|
3300 |
|
51117226 |
ezhjw |
G |
March 10, 2019, 7:32 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
109 |
8089600 |
|
3300 |
|
57886147 |
lopare |
G |
July 28, 2019, 9:59 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
124 |
16486400 |
|
3300 |
|
57817978 |
py_ultron |
G |
July 26, 2019, 8:52 p.m. |
OK |
GNU C++11 |
TESTS |
45 |
124 |
16486400 |
|
3300 |
|
50041704 |
luogu_bot3 |
G |
Feb. 17, 2019, 2:33 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
124 |
19456000 |
|
3300 |
|
50041685 |
luogu_bot2 |
G |
Feb. 17, 2019, 2:32 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
124 |
19456000 |
|
3300 |
|
50041677 |
cx233666 |
G |
Feb. 17, 2019, 2:32 a.m. |
OK |
GNU C++11 |
TESTS |
45 |
124 |
19456000 |
|
3300 |
|
51126599 |
RogerDTZ |
G |
March 10, 2019, 11:53 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
93 |
34508800 |
|
3300 |
|
38608012 |
RogerDTZ |
G |
May 25, 2018, 11:57 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
171 |
7270400 |
|
3300 |
|
66452495 |
yhx-12243 |
G |
Dec. 7, 2019, 11:59 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
186 |
16486400 |
|
3300 |
|
33980019 |
skylee |
G |
Jan. 7, 2018, 9:45 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
202 |
10444800 |
|
3300 |
|
50603290 |
jhdjames37 |
G |
Feb. 28, 2019, 1:34 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
202 |
16076800 |
|
3300 |
|
65707381 |
wucstdio |
G |
Nov. 25, 2019, 1:03 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
202 |
178995200 |
|
3300 |
|
66497435 |
ruogu |
G |
Dec. 8, 2019, 11:07 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
249 |
15360000 |
|
3300 |
|
40259428 |
The_Unbeatable |
G |
July 13, 2018, 11:26 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
265 |
33792000 |
|
3300 |
|
48032432 |
yfzcsc |
G |
Jan. 6, 2019, 1:16 p.m. |
OK |
GNU C++14 |
TESTS |
45 |
265 |
69017600 |
|
3300 |
|
63056938 |
Cyanic |
G |
Oct. 21, 2019, 6:49 a.m. |
OK |
GNU C++14 |
TESTS |
45 |
280 |
22630400 |
|
3300 |
|
68403691 |
xht37 |
G |
Jan. 8, 2020, 2:05 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
171 |
49459200 |
|
3300 |
|
69832416 |
gongsuidashen |
G |
Jan. 30, 2020, 10:55 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
202 |
29798400 |
|
3300 |
|
68754087 |
xymtxdy |
G |
Jan. 14, 2020, 7:42 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
202 |
41267200 |
|
3300 |
|
69724399 |
yuhaw |
G |
Jan. 29, 2020, 11:47 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
217 |
55398400 |
|
3300 |
|
59190658 |
Benq |
G |
Aug. 20, 2019, 8:52 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
218 |
32768000 |
|
3300 |
|
63774330 |
ruo |
G |
Oct. 30, 2019, 9 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
233 |
29798400 |
|
3300 |
|
68427384 |
Elegia |
G |
Jan. 9, 2020, 4:40 a.m. |
OK |
GNU C++17 |
TESTS |
45 |
249 |
27033600 |
|
3300 |
|
52463012 |
Rose_max |
G |
April 7, 2019, 2:13 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
265 |
19251200 |
|
3300 |
|
63728730 |
alan_cty |
G |
Oct. 29, 2019, 1:25 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
280 |
23244800 |
|
3300 |
|
68865797 |
HirasawaaYui |
G |
Jan. 15, 2020, 1:33 p.m. |
OK |
GNU C++17 |
TESTS |
45 |
296 |
31948800 |
|
3300 |
|
10744259 |
fmoraes |
G |
April 16, 2015, 5:44 p.m. |
OK |
Java 8 |
TESTS |
45 |
498 |
14745600 |
|
3300 |
|
14314450 |
Los_Angelos_Laycurse |
G |
Nov. 17, 2015, 2:51 p.m. |
OK |
MS C++ |
TESTS |
45 |
218 |
34713600 |
|
3300 |
|
14314472 |
Los_Angelos_Laycurse |
G |
Nov. 17, 2015, 2:53 p.m. |
OK |
MS C++ |
TESTS |
45 |
249 |
34713600 |
|
3300 |
remove filters
Back to search problems