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 |
| 176
|
Croc Champ 2012 - Round 2 |
FINISHED |
False |
7200 |
441471323 |
April 20, 2012, 3:05 p.m. |
Problems
This time you should help a team of researchers on an island in the Pacific Ocean. They research the culture of the ancient tribes that used to inhabit the island many years ago. Overall they've dug out n villages. Some pairs of villages were connected by roads. People could go on the roads in both directions. Overall there were exactly n - 1 roads, and from any village one could get to any other one. The tribes were not peaceful, and they had many wars. As a result of the wars, some villages were completely destroyed. During more peaceful years, some of the villages were restored. At each moment of time, people used only those roads that belonged to some shortest way between two villages that existed at the given moment . In other words, people used the minimum subset of roads in such a way that it was possible to get from any existing village to any other existing one. Note that throughout the island's whole history, there existed exactly n - 1 roads that have been found by the researchers. There never were any other roads. The researchers think that observing the total sum of used roads' lengths at different moments of time can help to better understand the tribes' culture and answer several historical questions. You will be given the full history of the tribes' existence. Your task is to determine the total length of used roads at some moments of time. The first line contains an integer n ( 1 ≤ n ≤ 10 5 ) — the number of villages. The next n - 1 lines describe the roads. The i -th of these lines contains three integers a i , b i , and c i ( 1 ≤ a i , b i ≤ n , a i ≠ b i , 1 ≤ c i ≤ 10 9 , 1 ≤ i < n ) — the numbers of villages that are connected by the i -th road and the road's length. The numbers in the lines are separated by a space. The next line contains an integer q ( 1 ≤ q ≤ 10 5 ) — the number of queries. Then follow q queries, one per line, ordered by time. Each query belongs to one of three types: " + x " — village number x is restored ( 1 ≤ x |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
2876554 |
luogan |
E |
Jan. 6, 2013, 2:48 a.m. |
OK |
FPC |
TESTS |
55 |
296 |
27545600 |
|
3000 |
|
1633138 |
coolinging |
E |
April 28, 2012, 5:31 a.m. |
OK |
FPC |
TESTS |
55 |
300 |
15872000 |
|
3000 |
|
1618572 |
zanoes |
E |
April 23, 2012, 3:43 p.m. |
OK |
FPC |
TESTS |
55 |
310 |
28569600 |
|
3000 |
|
11722493 |
ez_cjb |
E |
June 23, 2015, 12:08 p.m. |
OK |
FPC |
TESTS |
55 |
498 |
15155200 |
|
3000 |
|
5924076 |
zhzq123 |
E |
March 4, 2014, 2:01 p.m. |
OK |
FPC |
TESTS |
55 |
498 |
15257600 |
|
3000 |
|
1710331 |
blackapple |
E |
May 23, 2012, 4:01 a.m. |
OK |
FPC |
TESTS |
55 |
530 |
36966400 |
|
3000 |
|
3111100 |
stevenyu |
E |
Feb. 13, 2013, 10:26 a.m. |
OK |
FPC |
TESTS |
55 |
609 |
35532800 |
|
3000 |
|
2875501 |
shyoshyohw1 |
E |
Jan. 5, 2013, 3:23 p.m. |
OK |
GNU C++ |
TESTS |
55 |
140 |
27136000 |
|
3000 |
|
4930577 |
vjudge1 |
E |
Oct. 29, 2013, 6:39 p.m. |
OK |
GNU C++ |
TESTS |
55 |
202 |
21196800 |
|
3000 |
|
3652650 |
hehaodele |
E |
April 30, 2013, 2:40 a.m. |
OK |
GNU C++ |
TESTS |
55 |
203 |
12083200 |
|
3000 |
|
2824322 |
Seasons |
E |
Dec. 25, 2012, 4:43 a.m. |
OK |
GNU C++ |
TESTS |
55 |
218 |
13926400 |
|
3000 |
|
2585227 |
CMHJT |
E |
Nov. 18, 2012, 1:12 p.m. |
OK |
GNU C++ |
TESTS |
55 |
234 |
11673600 |
|
3000 |
|
4930680 |
SoroushE |
E |
Oct. 29, 2013, 7:05 p.m. |
OK |
GNU C++ |
TESTS |
55 |
234 |
24576000 |
|
3000 |
|
35757137 |
vjudge5 |
E |
Feb. 27, 2018, 9:37 a.m. |
OK |
GNU C++ |
TESTS |
55 |
248 |
12902400 |
|
3000 |
|
35757131 |
cqbz163003gzm |
E |
Feb. 27, 2018, 9:37 a.m. |
OK |
GNU C++ |
TESTS |
55 |
248 |
12902400 |
|
3000 |
|
35754942 |
Hineven |
E |
Feb. 27, 2018, 8:01 a.m. |
OK |
GNU C++ |
TESTS |
55 |
248 |
12902400 |
|
3000 |
|
2800089 |
qquartz |
E |
Dec. 21, 2012, 2:57 a.m. |
OK |
GNU C++ |
TESTS |
55 |
265 |
10240000 |
|
3000 |
|
2855902 |
bakabakashyoshyo |
E |
Dec. 30, 2012, 7:15 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
156 |
27136000 |
|
3000 |
|
2751574 |
roosephu |
E |
Dec. 11, 2012, 2:35 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
328 |
13926400 |
|
3000 |
|
9493826 |
hkglly |
E |
Jan. 21, 2015, 2:44 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
374 |
20377600 |
|
3000 |
|
9815913 |
Pudge123 |
E |
Feb. 13, 2015, 12:35 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
436 |
21708800 |
|
3000 |
|
2423705 |
Archon.JK |
E |
Oct. 25, 2012, 3:32 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
437 |
31641600 |
|
3000 |
|
2454818 |
dc. |
E |
Oct. 28, 2012, 7:23 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
500 |
20070400 |
|
3000 |
|
6863213 |
persianpars |
E |
June 11, 2014, 9:06 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
560 |
18739200 |
|
3000 |
|
7948869 |
xtrome |
E |
Sept. 25, 2014, 3:55 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
560 |
22630400 |
|
3000 |
|
9339957 |
DarthKnight |
E |
Jan. 1, 2015, 3:34 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
592 |
31641600 |
|
3000 |
|
7931339 |
aliasadiiii |
E |
Sept. 23, 2014, 9:33 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
654 |
36147200 |
|
3000 |
|
40991483 |
ReaLNero1 |
E |
July 31, 2018, 12:40 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
216 |
27033600 |
|
3000 |
|
18855034 |
vjudge1 |
E |
July 2, 2016, 1:48 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
218 |
10035200 |
|
3000 |
|
55813853 |
luogu_bot2 |
E |
June 20, 2019, 5:28 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
218 |
10854400 |
|
3000 |
|
55813833 |
PaulShi |
E |
June 20, 2019, 5:27 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
218 |
10854400 |
|
3000 |
|
58844547 |
luogu_bot4 |
E |
Aug. 15, 2019, 4:25 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
248 |
10854400 |
|
3000 |
|
58844533 |
xcxxcx |
E |
Aug. 15, 2019, 4:24 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
248 |
10854400 |
|
3000 |
|
52151763 |
LJC00118 |
E |
April 1, 2019, 11:53 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
248 |
12492800 |
|
3000 |
|
53854092 |
FightForWin |
E |
May 7, 2019, 3:05 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
248 |
17305600 |
|
3000 |
|
53781907 |
memset0c |
E |
May 5, 2019, 9:12 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
248 |
17305600 |
|
3000 |
|
53781504 |
xor5283 |
E |
May 5, 2019, 9:07 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
248 |
17305600 |
|
3000 |
|
54784405 |
Fischer |
E |
May 29, 2019, 2:26 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
342 |
21708800 |
|
3000 |
|
36907145 |
jcg |
E |
April 3, 2018, 4:02 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
404 |
19046400 |
|
3000 |
|
57875606 |
PinkRabbit |
E |
July 28, 2019, 5:05 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
434 |
12185600 |
|
3000 |
|
36907023 |
jcg |
E |
April 3, 2018, 3:56 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
434 |
32460800 |
|
3000 |
|
48082878 |
boatinw99 |
E |
Jan. 8, 2019, 9:11 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
436 |
19148800 |
|
3000 |
|
54785324 |
Fischer |
E |
May 29, 2019, 3:18 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
436 |
21094400 |
|
3000 |
|
32346752 |
vjudge5 |
E |
Nov. 16, 2017, 4:12 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
436 |
21913600 |
|
3000 |
|
68451578 |
MakeSPGreatAgain |
E |
Jan. 9, 2020, 2:32 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
466 |
18739200 |
|
3000 |
|
32346746 |
OPG |
E |
Nov. 16, 2017, 4:11 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
466 |
21913600 |
|
3000 |
|
39962724 |
smokescreen |
E |
July 4, 2018, 5:26 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
468 |
19148800 |
|
3000 |
|
52295335 |
Night |
E |
April 4, 2019, 5:45 a.m. |
OK |
GNU C++17 |
TESTS |
55 |
374 |
65638400 |
|
3000 |
|
60353747 |
AliShahali1382 |
E |
Sept. 10, 2019, 3:18 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
434 |
18739200 |
|
3000 |
|
68610553 |
davooddkareshki |
E |
Jan. 11, 2020, 3:32 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
436 |
20787200 |
|
3000 |
|
46403230 |
NelsonGomesNeto |
E |
Nov. 30, 2018, 1:18 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
466 |
20480000 |
|
3000 |
|
46261741 |
AryssonFigueiredo |
E |
Nov. 26, 2018, 8:39 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
498 |
20582400 |
|
3000 |
|
68610453 |
davooddkareshki |
E |
Jan. 11, 2020, 3:30 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
498 |
20787200 |
|
3000 |
|
61727244 |
smhh22 |
E |
Oct. 2, 2019, 3:48 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
498 |
34201600 |
|
3000 |
|
52295142 |
Night |
E |
April 4, 2019, 5:38 a.m. |
OK |
GNU C++17 |
TESTS |
55 |
528 |
61644800 |
|
3000 |
|
46405215 |
NelsonGomesNeto |
E |
Nov. 30, 2018, 2:17 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
530 |
20480000 |
|
3000 |
|
52628306 |
Romeolong |
E |
April 12, 2019, 5:24 a.m. |
OK |
GNU C++17 |
TESTS |
55 |
530 |
28672000 |
|
3000 |
|
2687292 |
Ahmed.Ibrahem |
E |
Dec. 2, 2012, 5:27 p.m. |
OK |
Java 6 |
TESTS |
55 |
890 |
46796800 |
|
3000 |
|
2564535 |
Ahmed_Salama |
E |
Nov. 15, 2012, 5:02 p.m. |
OK |
Java 6 |
TESTS |
55 |
968 |
53862400 |
|
3000 |
|
9940074 |
AlexFetisov |
E |
Feb. 20, 2015, 5:02 p.m. |
OK |
Java 8 |
TESTS |
55 |
840 |
14643200 |
|
3000 |
|
3427861 |
LovelyPenguin |
E |
March 31, 2013, 2:54 p.m. |
OK |
MS C++ |
TESTS |
55 |
421 |
16691200 |
|
3000 |
|
3427841 |
LovelyPenguin |
E |
March 31, 2013, 2:51 p.m. |
OK |
MS C++ |
TESTS |
55 |
421 |
16691200 |
|
3000 |
|
1650489 |
caustique |
E |
May 3, 2012, 9:11 a.m. |
OK |
MS C++ |
TESTS |
55 |
770 |
24678400 |
|
3000 |
|
1613812 |
ballon |
E |
April 22, 2012, 2:43 p.m. |
OK |
MS C++ |
TESTS |
55 |
880 |
35225600 |
|
3000 |
|
1591610 |
al13n |
E |
April 20, 2012, 6:13 p.m. |
OK |
MS C++ |
TESTS |
55 |
1140 |
41984000 |
|
3000 |
remove filters
Back to search problems