Codeforces Beta Round 34 (Div. 2)

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
34 Codeforces Beta Round 34 (Div. 2) FINISHED False 7200 445021199 Oct. 11, 2010, 1 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5221 ) D Road Map PROGRAMMING dfs and similar graphs 1700

B"There are n cities in Berland. Each city has its index -- an integer number from 1 to n. The capital has index r1. All the roads in Berland are two-way. The road system is such that there is exactly one path from the capital to each city, i.e. the road map looks like a tree. In Berland's chronicles the road map is kept in the following way: for each city i, different from the capital, there is kept number pi -- index of the last city on the way from the capital to i. Once the king of Berland Berl XXXIV decided to move the capital from city r1 to city r2. Naturally, after this the old representation of the road map in Berland's chronicles became incorrect. Please, help the king find out a new representation of the road map in the way described above. The first line contains three space-separated integers n, r1, r2 (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xc2 xb7104, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r1 xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89r2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- amount of cities in Berland, index of the old capital and index of the new one, correspondingly. The following line contains n xe2 x80 x89- xe2 x80 x891 space-separated integers -- the old representation of the road map. For each city, apart from r1, there is given integer pi -- index of the last city on the way from the capital to city i. All the cities are described in order of increasing indexes. Output n xe2 x80 x89- xe2 x80 x891 numbers -- new representation of the road map in the same format."...

Tutorials

Codeforces Beta Round #34 (Div. 2) Разбор

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
58045786 vjudge1 D July 30, 2019, 11:13 p.m. OK Clang++17 Diagnostics TESTS 30 218 18227200 1700
47846780 Sk. D Jan. 2, 2019, 3:08 p.m. OK Clang++17 Diagnostics TESTS 30 358 1024000 1700
47847806 Sk. D Jan. 2, 2019, 3:47 p.m. OK Clang++17 Diagnostics TESTS 30 374 5632000 1700
2048258 Gassa D Aug. 25, 2012, 11:53 a.m. OK D TESTS 30 190 11161600 1700
4316209 VitalijD D Aug. 20, 2013, 2:23 p.m. OK Delphi TESTS 30 30 409600 1700
2789725 Misha100896 D Dec. 18, 2012, 6:27 a.m. OK Delphi TESTS 30 31 1638400 1700
2874637 Mosyagin D Jan. 5, 2013, 9:57 a.m. OK Delphi TESTS 30 46 2764800 1700
309311 ErzhanDS D Feb. 28, 2011, 10:33 a.m. OK Delphi TESTS 30 50 2867200 1700
2070078 AleksanderBalobanov D Aug. 30, 2012, 6:15 p.m. OK Delphi TESTS 30 50 11366400 1700
1750519 Ramp D June 1, 2012, 11:20 p.m. OK Delphi TESTS 30 50 17920000 1700
152626 mandarinka D Oct. 20, 2010, 6:07 p.m. OK Delphi TESTS 30 60 3584000 1700
951751 Spumote D Dec. 11, 2011, 2:36 p.m. OK Delphi TESTS 30 60 3993600 1700
3907074 Nik_Storm_2010 D June 16, 2013, 6:45 p.m. OK FPC TESTS 30 31 2150400 1700
539986 scorpion D July 9, 2011, 7:29 p.m. OK FPC TESTS 30 50 1228800 1700
330435 BIT D March 10, 2011, 8:19 p.m. OK FPC TESTS 30 50 1228800 1700
152079 cst D Oct. 14, 2010, 5:50 p.m. OK FPC TESTS 30 50 1228800 1700
152050 Waiter D Oct. 14, 2010, 1:44 p.m. OK FPC TESTS 30 50 1228800 1700
1042295 hnivhnivt8695 D Jan. 13, 2012, 4:44 a.m. OK FPC TESTS 30 50 1433600 1700
796976 phidang D Oct. 26, 2011, 1:32 p.m. OK FPC TESTS 30 50 1433600 1700
2210929 25122008 D Sept. 19, 2012, 4:06 a.m. OK FPC TESTS 30 50 4505600 1700
795974 siuvit D Oct. 26, 2011, 2:01 a.m. OK FPC TESTS 30 50 4505600 1700
796428 memphis0603 D Oct. 26, 2011, 8:20 a.m. OK FPC TESTS 30 50 4710400 1700
10927203 yusufk D April 29, 2015, 9:30 a.m. OK GNU C TESTS 30 31 3481600 1700
10929020 ibahadir.altun D April 29, 2015, 1:10 p.m. OK GNU C TESTS 30 31 3584000 1700
20954299 rainboy D Sept. 27, 2016, 6:47 p.m. OK GNU C TESTS 30 31 3686400 1700
17308118 scotch D April 13, 2016, 9:37 p.m. OK GNU C TESTS 30 46 204800 1700
10927292 harunsami D April 29, 2015, 9:45 a.m. OK GNU C TESTS 30 46 3379200 1700
20954371 rainboy D Sept. 27, 2016, 6:52 p.m. OK GNU C TESTS 30 46 3481600 1700
9784736 lsakenl D Feb. 10, 2015, 12:05 a.m. OK GNU C TESTS 30 46 4096000 1700
11809819 neerajbattan D June 27, 2015, 8:19 p.m. OK GNU C TESTS 30 46 4300800 1700
5146841 Zzyzx D Nov. 19, 2013, 5:19 a.m. OK GNU C TESTS 30 62 3481600 1700
20929453 rainboy D Sept. 26, 2016, 4:10 p.m. OK GNU C TESTS 30 1794 2457600 1700
28630281 vjudge1 D July 17, 2017, 6:51 a.m. OK GNU C++ TESTS 30 30 2355200 1700
19435033 saksham2405 D July 27, 2016, 6:49 a.m. OK GNU C++ TESTS 30 31 204800 1700
7301800 nikouni D July 31, 2014, 6:44 p.m. OK GNU C++ TESTS 30 31 204800 1700
6910455 vjudge2 D June 19, 2014, 5:54 a.m. OK GNU C++ TESTS 30 31 204800 1700
5917741 Amelius D March 3, 2014, 7:18 p.m. OK GNU C++ TESTS 30 31 204800 1700
9072777 vjudge4 D Dec. 10, 2014, 2:32 p.m. OK GNU C++ TESTS 30 31 409600 1700
9089840 vjudge1 D Dec. 12, 2014, 11:44 a.m. OK GNU C++ TESTS 30 31 819200 1700
7573099 vjudge1 D Aug. 25, 2014, 1:06 p.m. OK GNU C++ TESTS 30 31 1536000 1700
14204948 hasanb D Nov. 11, 2015, 9:21 p.m. OK GNU C++ TESTS 30 31 1843200 1700
28892805 vjudge5 D July 26, 2017, 3:27 a.m. OK GNU C++ TESTS 30 31 2252800 1700
7681188 peterpan D Sept. 4, 2014, 11:08 a.m. OK GNU C++0x TESTS 30 31 2048000 1700
6543539 webosholmes D May 4, 2014, 9:52 a.m. OK GNU C++0x TESTS 30 31 3788800 1700
7196202 user32 D July 21, 2014, 3:12 p.m. OK GNU C++0x TESTS 30 31 3891200 1700
3202135 lovefly1983 D Feb. 27, 2013, 10:29 a.m. OK GNU C++0x TESTS 30 46 1536000 1700
7118779 behzad.nouri D July 16, 2014, 8:23 p.m. OK GNU C++0x TESTS 30 46 2662400 1700
10018884 aleksandar.ljamzin D Feb. 25, 2015, 12:03 p.m. OK GNU C++0x TESTS 30 46 3686400 1700
8437770 hakobyan.tigran D Oct. 27, 2014, 4:51 p.m. OK GNU C++0x TESTS 30 46 3788800 1700
7794090 w0w D Sept. 14, 2014, 12:34 p.m. OK GNU C++0x TESTS 30 46 3891200 1700
6765355 ilovealyona D June 1, 2014, 11:49 a.m. OK GNU C++0x TESTS 30 46 3993600 1700
9305437 tommek D Dec. 30, 2014, 1:09 p.m. OK GNU C++0x TESTS 30 46 4096000 1700
47849115 vjudge4 D Jan. 2, 2019, 4:34 p.m. OK GNU C11 TESTS 30 171 2764800 1700
47621987 vjudge1 D Dec. 28, 2018, 1:14 p.m. OK GNU C11 TESTS 30 186 204800 1700
57277622 liv_curious D July 18, 2019, 11:30 a.m. OK GNU C11 TESTS 30 187 102400 1700
47638597 vjudge2 D Dec. 28, 2018, 3:16 p.m. OK GNU C11 TESTS 30 187 409600 1700
47493478 vjudge1 D Dec. 25, 2018, 1:38 p.m. OK GNU C11 TESTS 30 187 819200 1700
47447503 vjudge3 D Dec. 24, 2018, 7:20 a.m. OK GNU C11 TESTS 30 187 1536000 1700
47492951 1061109567 D Dec. 25, 2018, 1:19 p.m. OK GNU C11 TESTS 30 187 1740800 1700
47493219 1061109567 D Dec. 25, 2018, 1:28 p.m. OK GNU C11 TESTS 30 187 1740800 1700
47538389 vjudge5 D Dec. 27, 2018, 4:56 a.m. OK GNU C11 TESTS 30 187 2764800 1700
47463450 vjudge1 D Dec. 24, 2018, 4:27 p.m. OK GNU C11 TESTS 30 187 16076800 1700
48555436 vjudge4 D Jan. 19, 2019, 5:06 a.m. OK GNU C++11 TESTS 30 31 819200 1700
28630449 Maii D July 17, 2017, 6:57 a.m. OK GNU C++11 TESTS 30 31 2355200 1700
25444885 kuko- D March 12, 2017, 11:49 p.m. OK GNU C++11 TESTS 30 31 2457600 1700
17467353 vjudge2 D April 23, 2016, 9:14 a.m. OK GNU C++11 TESTS 30 31 2457600 1700
12859763 CyberZHG D Sept. 6, 2015, 2:29 a.m. OK GNU C++11 TESTS 30 31 2560000 1700
18757151 MohamedZain D June 27, 2016, 7:13 p.m. OK GNU C++11 TESTS 30 31 3379200 1700
18758539 Nouran_Abdelaziz D June 27, 2016, 9:33 p.m. OK GNU C++11 TESTS 30 31 3686400 1700
18757409 Noureldin D June 27, 2016, 7:39 p.m. OK GNU C++11 TESTS 30 31 3686400 1700
19718955 5120141477 D Aug. 8, 2016, 3:02 a.m. OK GNU C++11 TESTS 30 31 3686400 1700
19573071 x73 D Aug. 2, 2016, 6:12 a.m. OK GNU C++11 TESTS 30 31 3686400 1700
30759124 Mr.AAA D Sept. 26, 2017, 5:45 p.m. OK GNU C++14 TESTS 30 31 512000 1700
30044495 TripleM D Sept. 3, 2017, 11:25 p.m. OK GNU C++14 TESTS 30 31 3174400 1700
29155208 xiaoming.cn D Aug. 3, 2017, 12:28 p.m. OK GNU C++14 TESTS 30 31 3481600 1700
31190494 KyRillos_BoshRa D Oct. 10, 2017, 1:09 p.m. OK GNU C++14 TESTS 30 31 3788800 1700
33248720 amirala2013 D Dec. 14, 2017, 6:50 p.m. OK GNU C++14 TESTS 30 31 5017600 1700
28876962 jamnik D July 25, 2017, 1:20 p.m. OK GNU C++14 TESTS 30 31 5120000 1700
33213410 mohammadrobot D Dec. 13, 2017, 12:44 p.m. OK GNU C++14 TESTS 30 31 5120000 1700
23332427 _AymanSalah D Dec. 26, 2016, 4:28 a.m. OK GNU C++14 TESTS 30 31 5939200 1700
30239531 shubhiks1032 D Sept. 10, 2017, 7:18 a.m. OK GNU C++14 TESTS 30 31 6246400 1700
35521473 aloo123 D Feb. 20, 2018, 12:52 p.m. OK GNU C++14 TESTS 30 31 6246400 1700
50067646 tnakao D Feb. 17, 2019, 3:43 p.m. OK GNU C++17 TESTS 30 46 409600 1700
56303177 limage D June 30, 2019, 10:10 a.m. OK GNU C++17 TESTS 30 46 512000 1700
65289549 new_Start_CY D Nov. 18, 2019, 9:19 a.m. OK GNU C++17 TESTS 30 46 716800 1700
61946079 buddy_1 D Oct. 5, 2019, 11:21 p.m. OK GNU C++17 TESTS 30 46 2150400 1700
55577576 vjudge2 D June 15, 2019, 3:16 a.m. OK GNU C++17 TESTS 30 46 2457600 1700
49034430 vjudge5 D Jan. 27, 2019, 2 a.m. OK GNU C++17 TESTS 30 46 2560000 1700
62233025 mikimowski D Oct. 9, 2019, 9:26 p.m. OK GNU C++17 TESTS 30 46 2560000 1700
56248192 vjudge2 D June 28, 2019, 11:37 p.m. OK GNU C++17 TESTS 30 46 2764800 1700
59963045 Khaled.Emad D Sept. 3, 2019, 6:56 p.m. OK GNU C++17 TESTS 30 46 2764800 1700
58043425 vjudge3 D July 30, 2019, 9:03 p.m. OK GNU C++17 TESTS 30 46 2867200 1700
66815427 zhanyi_xiaolu D Dec. 14, 2019, 5:27 a.m. OK Java 11 TESTS 30 451 0 1700
152195 userlond D Oct. 15, 2010, 3:13 p.m. OK Java 6 TESTS 30 130 43315200 1700
639542 kiko91_7 D Aug. 27, 2011, 2:02 a.m. OK Java 6 TESTS 30 160 35430400 1700
498238 Sammarize D June 19, 2011, 11:01 p.m. OK Java 6 TESTS 30 160 43315200 1700
514159 Slamur D June 29, 2011, 4:23 p.m. OK Java 6 TESTS 30 170 43520000 1700
2903872 hama-du D Jan. 11, 2013, 3:49 a.m. OK Java 6 TESTS 30 171 2662400 1700
911440 nativea D Nov. 30, 2011, 12:12 p.m. OK Java 6 TESTS 30 190 37990400 1700
735178 trogloditas D Oct. 3, 2011, 2:21 a.m. OK Java 6 TESTS 30 200 38604800 1700
152757 I_love_Malika D Oct. 25, 2010, 12:08 p.m. OK Java 6 TESTS 30 200 43417600 1700
589118 dalex D Aug. 7, 2011, 10:01 a.m. OK Java 6 TESTS 30 220 43929600 1700
1149908 Mostafa.Ali D Feb. 4, 2012, 7:49 p.m. OK Java 6 TESTS 30 220 45260800 1700
10500275 starfishbits D March 28, 2015, 12:54 p.m. OK Java 7 TESTS 30 124 0 1700
11688059 mikcorer D June 21, 2015, 12:15 a.m. OK Java 7 TESTS 30 124 4198400 1700
17126052 DukeOfYork D April 2, 2016, 8:12 a.m. OK Java 7 TESTS 30 124 41062400 1700
11882607 ankitstone D July 1, 2015, 1:18 p.m. OK Java 7 TESTS 30 140 0 1700
10443802 sweiss D March 25, 2015, 2:11 p.m. OK Java 7 TESTS 30 140 0 1700
14580242 kws4679 D Dec. 1, 2015, 6:30 a.m. OK Java 7 TESTS 30 155 2150400 1700
7662958 myduomilia D Sept. 1, 2014, 5:51 p.m. OK Java 7 TESTS 30 155 2560000 1700
2960299 alexyz D Jan. 19, 2013, 3:51 p.m. OK Java 7 TESTS 30 171 1843200 1700
2519082 Bambam D Nov. 7, 2012, noon OK Java 7 TESTS 30 203 3174400 1700
5489386 0p9o8i D Dec. 21, 2013, 11:15 p.m. OK Java 7 TESTS 30 218 204800 1700
45330083 Jarik D Nov. 5, 2018, 2:48 p.m. OK Java 8 TESTS 30 124 0 1700
25109938 parth_1 D Feb. 28, 2017, 8:23 p.m. OK Java 8 TESTS 30 124 20684800 1700
45330249 Jarik D Nov. 5, 2018, 2:53 p.m. OK Java 8 TESTS 30 140 0 1700
45330215 Jarik D Nov. 5, 2018, 2:52 p.m. OK Java 8 TESTS 30 140 0 1700
45330020 Jarik D Nov. 5, 2018, 2:46 p.m. OK Java 8 TESTS 30 140 0 1700
14964624 poikniok D Dec. 24, 2015, 6:11 a.m. OK Java 8 TESTS 30 140 2560000 1700
17474358 ankeet D April 23, 2016, 9:05 p.m. OK Java 8 TESTS 30 140 21401600 1700
20761631 Ahmad_Elsagheer D Sept. 19, 2016, 5:25 p.m. OK Java 8 TESTS 30 155 0 1700
42876259 Ahmed_Diab D Sept. 15, 2018, 1:07 a.m. OK Java 8 TESTS 30 155 512000 1700
11393311 dhrumil140396 D June 2, 2015, 5:36 p.m. OK Java 8 TESTS 30 155 2150400 1700
6085476 Eeyore D March 20, 2014, 2:44 a.m. OK JavaScript TESTS 30 62 13209600 1700
47351522 moss3s D Dec. 22, 2018, 3:17 a.m. OK Kotlin TESTS 30 171 1126400 1700
22794300 og.kostya D Dec. 7, 2016, 6:05 p.m. OK MS C# TESTS 30 62 10342400 1700
6620366 AlexSam D May 15, 2014, 11:28 a.m. OK MS C# TESTS 30 77 7168000 1700
26099639 fr0st D April 3, 2017, 12:44 p.m. OK MS C# TESTS 30 77 24064000 1700
27926450 Mem D June 20, 2017, 1:51 p.m. OK MS C# TESTS 30 187 22630400 1700
3404346 vjudge5 D March 25, 2013, 1:17 p.m. OK MS C++ TESTS 30 31 204800 1700
6297070 Kazim D April 7, 2014, 6:18 p.m. OK MS C++ TESTS 30 31 3993600 1700
47661609 vjudge3 D Dec. 28, 2018, 7:22 p.m. OK MS C++ TESTS 30 31 4710400 1700
3404293 vjudge4 D March 25, 2013, 1:11 p.m. OK MS C++ TESTS 30 46 409600 1700
3331233 numitus D March 17, 2013, 3:36 p.m. OK MS C++ TESTS 30 46 409600 1700
48527089 vjudge3 D Jan. 18, 2019, 9:35 a.m. OK MS C++ TESTS 30 46 819200 1700
47661646 vjudge4 D Dec. 28, 2018, 7:24 p.m. OK MS C++ TESTS 30 46 4710400 1700
25255312 vjudge4 D March 5, 2017, 1:53 p.m. OK MS C++ TESTS 30 46 4915200 1700
17833522 jihad_dayoub D May 10, 2016, 3:03 p.m. OK MS C++ TESTS 30 46 5427200 1700
567353 vjudge3 D July 27, 2011, 1:34 p.m. OK MS C++ TESTS 30 60 2252800 1700
49210149 dharaniv1999 D Jan. 30, 2019, 3:17 p.m. OK MS C++ 2017 TESTS 30 62 3174400 1700
67142063 Prokopiy D Dec. 18, 2019, 7:13 a.m. OK MS C++ 2017 TESTS 30 93 2969600 1700
60301285 2018030401051 D Sept. 9, 2019, 12:15 p.m. OK MS C++ 2017 TESTS 30 109 3584000 1700
17126275 DukeOfYork D April 2, 2016, 8:24 a.m. OK Python 2 TESTS 30 93 8089600 1700
35861318 ______u______ D March 2, 2018, 10 p.m. OK Python 2 TESTS 30 93 8396800 1700
35861131 ______n______ D March 2, 2018, 9:55 p.m. OK Python 2 TESTS 30 93 8396800 1700
35860682 _____i_____ D March 2, 2018, 9:47 p.m. OK Python 2 TESTS 30 93 8396800 1700
35860616 _____k_____ D March 2, 2018, 9:45 p.m. OK Python 2 TESTS 30 93 8396800 1700
35857408 ______k______ D March 2, 2018, 8:39 p.m. OK Python 2 TESTS 30 93 8396800 1700
35857401 ______h______ D March 2, 2018, 8:39 p.m. OK Python 2 TESTS 30 93 8396800 1700
35856769 ______i______ D March 2, 2018, 8:27 p.m. OK Python 2 TESTS 30 93 8396800 1700
35854879 ______M______ D March 2, 2018, 7:51 p.m. OK Python 2 TESTS 30 93 8396800 1700
2928821 SiNZiyi D Jan. 16, 2013, 7:20 a.m. OK Python 2 TESTS 30 125 4198400 1700
5348394 yugle7 D Dec. 4, 2013, 2:39 p.m. OK Python 3 TESTS 30 156 3993600 1700
6657736 manoprenko D May 19, 2014, 1:26 p.m. OK Python 3 TESTS 30 248 92160000 1700
6016698 lemur D March 14, 2014, 7:18 p.m. OK Python 3 TESTS 30 280 6553600 1700
59682788 youness.amhaouch D Aug. 29, 2019, 10:03 p.m. OK Python 3 TESTS 30 342 10649600 1700
42156104 Mk_Python_v1 D Aug. 27, 2018, 2:47 p.m. OK Python 3 TESTS 30 374 6656000 1700

remove filters

Back to search problems