Helvetic Coding Contest 2017 online mirror (teams allowed, unrated)

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
802 Helvetic Coding Contest 2017 online mirror (teams allowed, unrated) FINISHED False 16200 280446923 May 28, 2017, 8:05 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 364 ) L Send the Fool Further! (hard) PROGRAMMING dfs and similar dp math trees 2800

Heidi is terrified by your estimate and she found it unrealistic that her friends would collaborate to drive her into debt. She expects that, actually, each person will just pick a random friend to send Heidi to. (This randomness assumption implies, however, that she can now visit the same friend an arbitrary number of times...) Moreover, if a person only has one friend in common with Heidi (i.e., if that person is in a leaf of the tree), then that person will not send Heidi back (so that Heidi's travel will end at some point). Heidi also found unrealistic the assumption that she can make all the travels in one day. Therefore now she assumes that every time she travels a route between two friends, she needs to buy a new ticket. She wants to know: how much should she expect to spend on the trips? For what it's worth, Heidi knows that Jenny has at least two friends. The first line contains the number of friends n ( 3 ≤ n ≤ 10 5 ). The next n - 1 lines each contain three space-separated integers u , v and c ( 0 ≤ u , v ≤ n - 1 , 1 ≤ c ≤ 10 4 ) meaning that u and v are friends and the cost for traveling between u and v is c (paid every time!). It is again guaranteed that the social network of the input forms a tree. Assume that the expected cost of the trips is written as an irreducible fraction a / b (that is, a and b are coprime). Then Heidi, the weird cow that she is, asks you to output . (Output a single integer between 0 and 10 9 + 6 .) In the first example, with probability 1 / 2 Heidi will go to 1 from 0 , and with probability 1 / 2 she will go to 2 . In the first case the cost would be 10 , and in the second it would be 20 . After reaching 1 or 2 she will stop, as 1 and 2 are leaves of the social tree. Hence, the expected cost she has to pay is 10·1 / 2 + 20·1 / 2 = 15 . In the third example, the expected cost is 81 / 5 . You should output 400000019 . In her travels, Heidi has learned an intriguing fact about the structure of her social network. She te

Tutorials

helvetic-coding-contest-2017-editorial.pdf

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
27542144 LeslieJRC L June 3, 2017, 11:20 a.m. OK GNU C++ TESTS 29 78 5324800 2800
35155898 wdyhy L Feb. 11, 2018, 2:38 p.m. OK GNU C++ TESTS 29 78 7065600 2800
37800608 luogu_bot2 L May 1, 2018, 1:54 p.m. OK GNU C++ TESTS 29 78 7782400 2800
27577039 AkaneSasu L June 5, 2017, 6:39 a.m. OK GNU C++ TESTS 29 93 3993600 2800
27413497 KrK L May 28, 2017, 1:04 p.m. OK GNU C++ TESTS 29 93 4198400 2800
27411621 black_horse2014 L May 28, 2017, 11:51 a.m. OK GNU C++ TESTS 29 93 5222400 2800
35155817 wdyhy L Feb. 11, 2018, 2:34 p.m. OK GNU C++ TESTS 29 93 7065600 2800
37800696 NaVi_Awson L May 1, 2018, 1:59 p.m. OK GNU C++ TESTS 29 93 7782400 2800
36721353 CSHwang L March 29, 2018, 1:22 p.m. OK GNU C++ TESTS 29 93 7987200 2800
27542639 jasonvictoryan L June 3, 2017, 11:48 a.m. OK GNU C++ TESTS 29 108 5734400 2800
40981036 ReaLNero1 L July 30, 2018, 5:48 p.m. OK GNU C++11 TESTS 29 46 4403200 2800
40541601 blutrex L July 19, 2018, 8:57 a.m. OK GNU C++11 TESTS 29 46 4403200 2800
27476842 sengxian L June 1, 2017, 3:33 a.m. OK GNU C++11 TESTS 29 61 4608000 2800
40541248 blutrex L July 19, 2018, 8:46 a.m. OK GNU C++11 TESTS 29 62 4403200 2800
27547230 chenxun L June 3, 2017, 2:54 p.m. OK GNU C++11 TESTS 29 78 4505600 2800
38778110 mengbierr L May 30, 2018, 3:28 p.m. OK GNU C++11 TESTS 29 78 14438400 2800
46062507 luogu_bot2 L Nov. 22, 2018, 2:05 p.m. OK GNU C++11 TESTS 29 93 4403200 2800
40541119 blutrex L July 19, 2018, 8:42 a.m. OK GNU C++11 TESTS 29 93 4403200 2800
56555168 KMAASZRAA L July 5, 2019, 11:59 a.m. OK GNU C++11 TESTS 29 93 5017600 2800
30310865 darknsux vodanhna minh141198 L Sept. 13, 2017, 3:44 p.m. OK GNU C++11 TESTS 29 93 5017600 2800
27448827 Andrei1998 L May 30, 2017, 1:15 p.m. OK GNU C++14 TESTS 29 108 5120000 2800
34122244 Emma194 L Jan. 13, 2018, 8:26 a.m. OK GNU C++14 TESTS 29 108 7065600 2800
27627244 WuHongxun L June 7, 2017, 7:11 a.m. OK GNU C++14 TESTS 29 109 5017600 2800
52863531 ddw L April 16, 2019, 4:25 p.m. OK GNU C++14 TESTS 29 109 9523200 2800
27476646 skipher. L June 1, 2017, 3:04 a.m. OK GNU C++14 TESTS 29 124 5427200 2800
27476636 skipher. L June 1, 2017, 3:02 a.m. OK GNU C++14 TESTS 29 124 5427200 2800
56843725 Minnakhmetov L July 11, 2019, 12:41 p.m. OK GNU C++14 TESTS 29 124 5939200 2800
34288370 CQzhangyu L Jan. 19, 2018, 12:58 a.m. OK GNU C++14 TESTS 29 124 7782400 2800
27661722 RNS_JKS L June 8, 2017, 2:36 a.m. OK GNU C++14 TESTS 29 124 7884800 2800
35779344 wfj_2048 L Feb. 28, 2018, 9:04 a.m. OK GNU C++14 TESTS 29 139 5222400 2800
69422881 hjk1030 L Jan. 23, 2020, 2:55 p.m. OK GNU C++17 TESTS 29 124 5120000 2800
51988598 alex_Harry L March 29, 2019, 6:43 p.m. OK GNU C++17 TESTS 29 124 5120000 2800
48980413 zhangqingqi L Jan. 26, 2019, 10:28 a.m. OK GNU C++17 TESTS 29 139 14438400 2800
45323653 fcwww L Nov. 5, 2018, 11:51 a.m. OK GNU C++17 TESTS 29 156 6553600 2800
42246256 Benq L Aug. 29, 2018, 3:28 p.m. OK GNU C++17 TESTS 29 171 5120000 2800
60254666 HirasawaaYui L Sept. 8, 2019, 8:47 a.m. OK GNU C++17 TESTS 29 202 5939200 2800

remove filters

Back to search problems