Codeforces Round 362 (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
696 Codeforces Round 362 (Div. 1) FINISHED False 8100 269097904 July 14, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3553 ) B Puzzles PROGRAMMING dfs and similar math probabilities trees 1800

B"Barney lives in country USC (United States of Charzeh). USC has n cities numbered from 1 through n and n xe2 x80 x89- xe2 x80 x891 roads between them. Cities and roads of USC form a rooted tree (Barney's not sure why it is rooted). Root of the tree is the city number 1. Thus if one will start his journey from city 1, he can visit any city he wants by following roads. Some girl has stolen Barney's heart, and Barney wants to find her. He starts looking for in the root of the tree and (since he is Barney Stinson not a random guy), he uses a random DFS to search in the cities. A pseudo code of this algorithm is as follows: As told before, Barney will start his journey in the root of the tree (equivalent to call dfs(1)). Now Barney needs to pack a backpack and so he wants to know more about his upcoming journey: for every city i, Barney wants to know the expected value of starting_time[i]. He's a friend of Jon Snow and knows nothing, that's why he asked for your help. The first line of input contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of cities in USC. The second line contains n xe2 x80 x89- xe2 x80 x891 integers p2, xe2 x80 x89p3, xe2 x80 x89..., xe2 x80 x89pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89< xe2 x80 x89i), where pi is the number of the parent city of city number i in the tree, meaning there is a road between cities numbered pi and i in USC. In the first and only line of output print n numbers, where i-th number is the expected value of starting_time[i]. Your answer for each city will be considered correct if its absolute or relative error does not exceed 10 xe2 x80 x89- xe2 x80 x896. "...

Tutorials

Codeforces Round #362 (Editorial)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
19172869 ruban B July 16, 2016, 12:08 p.m. OK Delphi TESTS 37 77 216780800 1800
22204482 myx12345 B Nov. 14, 2016, 8:39 a.m. OK FPC TESTS 37 280 6656000 1800
56702993 Holland_Pig B July 8, 2019, 10 a.m. OK FPC TESTS 37 327 6656000 1800
19133183 ice_tea B July 14, 2016, 7:24 p.m. OK FPC TESTS 37 327 19763200 1800
53592567 kfhkx B May 1, 2019, 1:35 a.m. OK FPC TESTS 37 343 97792000 1800
19310661 Noble_Mushtak B July 21, 2016, 11:50 p.m. OK GNU C TESTS 37 46 3993600 1800
19888317 wrongnumber Who1 coolxxx B Aug. 15, 2016, 12:56 p.m. OK GNU C TESTS 37 93 8601600 1800
21622920 rainboy B Oct. 20, 2016, 4:27 p.m. OK GNU C TESTS 37 155 8192000 1800
20038281 TsReaper B Aug. 22, 2016, 4 a.m. OK GNU C TESTS 37 156 9420800 1800
19126091 icerain94 B July 14, 2016, 5:51 p.m. OK GNU C++ TESTS 37 62 8396800 1800
19453370 Edward2173 B July 28, 2016, 3:37 a.m. OK GNU C++ TESTS 37 77 7987200 1800
20605753 AkaneSasu B Sept. 14, 2016, 5:12 a.m. OK GNU C++ TESTS 37 78 5017600 1800
29617143 vjudge2 B Aug. 20, 2017, 9:20 a.m. OK GNU C++ TESTS 37 78 5529600 1800
28900730 hzoi-MAFIA B July 26, 2017, 10:01 a.m. OK GNU C++ TESTS 37 78 6553600 1800
31612272 vjudge5 B Oct. 22, 2017, 7:15 p.m. OK GNU C++ TESTS 37 78 8089600 1800
19206523 vjudge4 B July 18, 2016, 8:13 a.m. OK GNU C++ TESTS 37 78 8396800 1800
23547351 vjudge5 B Jan. 5, 2017, 3:56 a.m. OK GNU C++ TESTS 37 78 9113600 1800
23672637 cilebritain B Jan. 10, 2017, 12:57 a.m. OK GNU C++ TESTS 37 78 9318400 1800
31626997 vjudge3 B Oct. 23, 2017, 11:38 a.m. OK GNU C++ TESTS 37 78 9625600 1800
40984085 ReaLNero1 B July 30, 2018, 7:11 p.m. OK GNU C++11 TESTS 37 31 5222400 1800
19211584 I_Love_Ginger B July 18, 2016, 12:05 p.m. OK GNU C++11 TESTS 37 46 7987200 1800
19117673 woqja125 B July 14, 2016, 4:59 p.m. OK GNU C++11 TESTS 37 62 1024000 1800
19119265 HellKitsune B July 14, 2016, 5:07 p.m. OK GNU C++11 TESTS 37 62 1228800 1800
68293936 vjudge4 B Jan. 6, 2020, 12:34 a.m. OK GNU C++11 TESTS 37 62 1638400 1800
68293930 vjudge5 B Jan. 6, 2020, 12:33 a.m. OK GNU C++11 TESTS 37 62 1638400 1800
19728323 geniucos B Aug. 8, 2016, 12:44 p.m. OK GNU C++11 TESTS 37 62 3276800 1800
19120671 Emarci15 B July 14, 2016, 5:14 p.m. OK GNU C++11 TESTS 37 62 5017600 1800
19122561 Butane B July 14, 2016, 5:25 p.m. OK GNU C++11 TESTS 37 62 8396800 1800
23364742 Ali.Pi B Dec. 27, 2016, 6:08 p.m. OK GNU C++11 TESTS 37 62 10035200 1800
58231475 ae04071 B Aug. 3, 2019, 5:03 p.m. OK GNU C++14 TESTS 37 62 8192000 1800
25432534 aps B March 12, 2017, 11:12 a.m. OK GNU C++14 TESTS 37 62 10444800 1800
23210395 chintu B Dec. 21, 2016, 8:50 p.m. OK GNU C++14 TESTS 37 77 3072000 1800
27138845 lukecavabarrett B May 15, 2017, 5:04 p.m. OK GNU C++14 TESTS 37 77 8601600 1800
25885413 Foster__ B March 29, 2017, 12:30 a.m. OK GNU C++14 TESTS 37 93 3481600 1800
68382065 vjudge5 B Jan. 8, 2020, 2:22 a.m. OK GNU C++14 TESTS 37 93 10342400 1800
31716034 .st B Oct. 25, 2017, 3:37 p.m. OK GNU C++14 TESTS 37 108 9318400 1800
23509238 MashiroSky B Jan. 3, 2017, 3:26 a.m. OK GNU C++14 TESTS 37 108 9932800 1800
23167972 tick B Dec. 20, 2016, 2:29 a.m. OK GNU C++14 TESTS 37 108 9932800 1800
56536615 vjudge4 B July 5, 2019, 1:32 a.m. OK GNU C++14 TESTS 37 108 10444800 1800
49538382 PavelChadnov B Feb. 6, 2019, 5:06 p.m. OK GNU C++17 TESTS 37 77 10547200 1800
60208918 Rzepa B Sept. 7, 2019, 9:18 a.m. OK GNU C++17 TESTS 37 93 38604800 1800
55533221 jt_112 B June 13, 2019, 2:48 p.m. OK GNU C++17 TESTS 37 108 6246400 1800
53687366 bit_lhj B May 3, 2019, 2:08 a.m. OK GNU C++17 TESTS 37 108 7168000 1800
44953832 hsfzLZH1 B Oct. 27, 2018, 1:20 p.m. OK GNU C++17 TESTS 37 108 7168000 1800
42800758 Steven_Meng B Sept. 12, 2018, 2:09 p.m. OK GNU C++17 TESTS 37 109 5017600 1800
53019470 vjudge1 B April 19, 2019, 3:45 p.m. OK GNU C++17 TESTS 37 109 7168000 1800
54741232 66990208 B May 28, 2019, 8:04 a.m. OK GNU C++17 TESTS 37 109 8908800 1800
62365005 Yousry B Oct. 11, 2019, 1:34 p.m. OK GNU C++17 TESTS 37 109 9011200 1800
52883248 vjudge1 B April 17, 2019, 2:43 a.m. OK GNU C++17 TESTS 37 109 9011200 1800
19304283 rohansumant B July 21, 2016, 2:36 p.m. OK Go TESTS 37 546 25088000 1800
19200402 vitruvius B July 18, 2016, 4:12 a.m. OK Java 7 TESTS 37 374 16281600 1800
19122698 PlayLikeNeverB4 B July 14, 2016, 5:26 p.m. OK Java 7 TESTS 37 499 7372800 1800
19133097 sqrtdecompton B July 14, 2016, 7:23 p.m. OK Java 7 TESTS 37 545 4710400 1800
19434602 vjudge2 B July 27, 2016, 6:22 a.m. OK Java 7 TESTS 37 764 18534400 1800
20514085 dharm0us B Sept. 10, 2016, 7:01 p.m. OK Java 8 TESTS 37 202 0 1800
19219553 pallavi B July 18, 2016, 8:26 p.m. OK Java 8 TESTS 37 217 0 1800
68326515 saurabhs1206 B Jan. 6, 2020, 5:04 p.m. OK Java 8 TESTS 37 218 15974400 1800
19502252 atinjosan B July 29, 2016, 7:27 p.m. OK Java 8 TESTS 37 233 0 1800
19545157 carvajal B July 31, 2016, 8:50 p.m. OK Java 8 TESTS 37 233 7884800 1800
19455458 AlexFetisov B July 28, 2016, 6:25 a.m. OK Java 8 TESTS 37 233 9113600 1800
19166527 uwi B July 16, 2016, 5:46 a.m. OK Java 8 TESTS 37 248 0 1800
29209115 Jael B Aug. 5, 2017, 4:29 a.m. OK Java 8 TESTS 37 265 39014400 1800
19116042 Sumeet.Varma B July 14, 2016, 4:52 p.m. OK Java 8 TESTS 37 280 40550400 1800
19134529 hiro116s B July 14, 2016, 7:44 p.m. OK Java 8 TESTS 37 295 46592000 1800
22515170 og.kostya B Nov. 26, 2016, 6:33 p.m. OK MS C# TESTS 37 140 18534400 1800
22515119 og.kostya B Nov. 26, 2016, 6:30 p.m. OK MS C# TESTS 37 140 19763200 1800
19119689 azukun B July 14, 2016, 5:09 p.m. OK MS C# TESTS 37 155 33587200 1800
20493011 Spi B Sept. 10, 2016, 8:29 a.m. OK MS C# TESTS 37 171 29696000 1800
19119409 haitao B July 14, 2016, 5:08 p.m. OK MS C# TESTS 37 217 31846400 1800
19113610 waItz7I9 B July 14, 2016, 4:44 p.m. OK MS C++ TESTS 37 62 5222400 1800
19138574 holc B July 15, 2016, 12:55 a.m. OK MS C++ TESTS 37 109 7577600 1800
19146497 rkm0959 B July 15, 2016, 7:38 a.m. OK MS C++ TESTS 37 124 1740800 1800
22941805 scorpiowf B Dec. 14, 2016, 5:09 a.m. OK MS C++ TESTS 37 124 6860800 1800
19133124 DimonK B July 14, 2016, 7:23 p.m. OK MS C++ TESTS 37 124 8396800 1800
19901531 AleksanderBalobanov B Aug. 16, 2016, 6:38 a.m. OK MS C++ TESTS 37 124 34508800 1800
19118816 Taube B July 14, 2016, 5:04 p.m. OK MS C++ TESTS 37 140 6860800 1800
19122979 GGOSinon B July 14, 2016, 5:28 p.m. OK MS C++ TESTS 37 140 8806400 1800
19117356 Michael B July 14, 2016, 4:57 p.m. OK MS C++ TESTS 37 140 9216000 1800
19149437 Auster B July 15, 2016, 9:36 a.m. OK MS C++ TESTS 37 140 17203200 1800
57427246 IPRIT B July 20, 2019, 9:15 p.m. OK MS C++ 2017 TESTS 37 202 6758400 1800
57328335 IPRIT B July 19, 2019, 1:05 p.m. OK MS C++ 2017 TESTS 37 218 6860800 1800
57331729 IPRIT B July 19, 2019, 2:28 p.m. OK MS C++ 2017 TESTS 37 234 6860800 1800
57344218 IPRIT B July 19, 2019, 9:07 p.m. OK MS C++ 2017 TESTS 37 249 13107200 1800
19118777 nwi B July 14, 2016, 5:04 p.m. OK Python 2 TESTS 37 280 15769600 1800
19820205 tjsumonster B Aug. 12, 2016, 5:51 a.m. OK Python 2 TESTS 37 529 19558400 1800
19144902 vjudge1 B July 15, 2016, 6:37 a.m. OK Python 3 TESTS 37 451 20889600 1800
19144882 NotHere B July 15, 2016, 6:37 a.m. OK Python 3 TESTS 37 467 20889600 1800
19286006 Abolfazl0079 B July 20, 2016, 6:05 p.m. OK Python 3 TESTS 37 467 21299200 1800
42129031 Mk_Python_v1 B Aug. 26, 2018, 5:10 p.m. OK Python 3 TESTS 37 514 21299200 1800
20225511 Remarque B Aug. 29, 2016, 8:27 a.m. OK Python 3 TESTS 37 592 21606400 1800
35101879 vjudge3 B Feb. 9, 2018, 6:19 p.m. OK Python 3 TESTS 37 951 30105600 1800
19468275 yarrr B July 28, 2016, 8:52 p.m. OK Rust TESTS 37 93 74035200 1800
19468285 yarrr B July 28, 2016, 8:53 p.m. OK Rust TESTS 37 109 23654400 1800
19155577 lal B July 15, 2016, 2:27 p.m. OK Scala TESTS 37 748 177971200 1800
19159630 I_love_Malika B July 15, 2016, 6:18 p.m. OK Scala TESTS 37 982 190566400 1800

remove filters

Back to search problems