Educational Codeforces Round 49 (Rated for 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
1027 Educational Codeforces Round 49 (Rated for Div. 2) FINISHED False 7200 197220299 Aug. 18, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7522 ) D Mouse Hunt PROGRAMMING dfs and similar graphs 1700

B"Medicine faculty of Berland State University has just finished their admission campaign. As usual, about 80 % of applicants are girls and majority of them are going to live in the university dormitory for the next 4 (hopefully) years. The dormitory consists of n rooms and a single mouse! Girls decided to set mouse traps in some rooms to get rid of the horrible monster. Setting a trap in room number i costs c_i burles. Rooms are numbered from 1 to n . Mouse doesn't sit in place all the time, it constantly runs. If it is in room i in second t then it will run to room a_i in second t + 1 without visiting any other rooms inbetween ( i = a_i means that mouse won't leave room i ). It's second 0 in the start. If the mouse is in some room with a mouse trap in it, then the mouse get caught into this trap. That would have been so easy if the girls actually knew where the mouse at. Unfortunately, that's not the case, mouse can be in any room from 1 to n at second 0 . What it the minimal total amount of burles girls can spend to set the traps in order to guarantee that the mouse will eventually be caught no matter the room it started from? The first line contains as single integers n ( 1 <= n <= 2 cdot 10^5 ) -- the number of rooms in the dormitory. The second line contains n integers c_1, c_2, ... , c_n ( 1 <= c_i <= 10^4 ) -- c_i is the cost of setting the trap in room number i . The third line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) -- a_i is the room the mouse will run to the next second after being in room i . Print a single integer -- the minimal total amount of burles girls can spend to set the traps in order to guarantee that the mouse will eventually be caught no matter the room it started from. In the first example it is enough to set mouse trap in rooms 1 and $$"...

Tutorials

Educational Codeforces Round 49 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
43073588 Muhammad-2004 D Sept. 19, 2018, 10:37 a.m. OK Clang++17 Diagnostics TESTS 69 171 1433600 1700
60966134 TerryTao D Sept. 21, 2019, 7:05 a.m. OK Clang++17 Diagnostics TESTS 69 202 90828800 1700
60965832 TerryTao D Sept. 21, 2019, 6:59 a.m. OK Clang++17 Diagnostics TESTS 69 202 90828800 1700
44234108 vjudge4 D Oct. 13, 2018, 3:08 a.m. OK Clang++17 Diagnostics TESTS 69 249 103424000 1700
41878191 rr_ D Aug. 19, 2018, 10:46 p.m. OK D TESTS 69 108 18636800 1700
41878218 rr_ D Aug. 19, 2018, 10:48 p.m. OK D TESTS 69 108 20172800 1700
41878238 rr_ D Aug. 19, 2018, 10:50 p.m. OK D TESTS 69 109 20172800 1700
62252045 HVP.exe D Oct. 10, 2019, 9:34 a.m. OK FPC TESTS 69 93 4608000 1700
49193068 chaorenhaha D Jan. 30, 2019, 9:04 a.m. OK FPC TESTS 69 93 5017600 1700
42437654 TShT D Sept. 3, 2018, 6:18 p.m. OK FPC TESTS 69 93 6041600 1700
62343658 HVP.exe D Oct. 11, 2019, 6:29 a.m. OK FPC TESTS 69 93 12083200 1700
46925272 Khanh_Moriaty D Dec. 12, 2018, 8:13 a.m. OK FPC TESTS 69 108 12288000 1700
41922334 Tancer D Aug. 21, 2018, 5:22 a.m. OK GNU C++ TESTS 69 31 3174400 1700
42197654 vjudge4 D Aug. 28, 2018, 7:14 a.m. OK GNU C++ TESTS 69 31 3481600 1700
42121064 xxjAc D Aug. 26, 2018, 12:30 p.m. OK GNU C++ TESTS 69 31 8806400 1700
41990831 hangyesheng D Aug. 23, 2018, 8:44 a.m. OK GNU C++ TESTS 69 31 11161600 1700
41962304 hhr D Aug. 22, 2018, 10:10 a.m. OK GNU C++ TESTS 69 46 2252800 1700
42364543 hzy9819 D Sept. 2, 2018, 1:50 p.m. OK GNU C++ TESTS 69 46 2457600 1700
42198798 vjudge4 D Aug. 28, 2018, 7:47 a.m. OK GNU C++ TESTS 69 46 2662400 1700
42198774 luogu_bot5 D Aug. 28, 2018, 7:46 a.m. OK GNU C++ TESTS 69 46 2662400 1700
41813662 luogu_bot4 D Aug. 19, 2018, 5:16 a.m. OK GNU C++ TESTS 69 46 3072000 1700
42000993 vjudge5 D Aug. 23, 2018, 3:08 p.m. OK GNU C++ TESTS 69 46 3379200 1700
50291355 rainboy D Feb. 21, 2019, 5:37 p.m. OK GNU C11 TESTS 69 78 2457600 1700
41935693 tall15421542 D Aug. 21, 2018, 12:52 p.m. OK GNU C11 TESTS 69 93 9625600 1700
41885403 Sooke D Aug. 20, 2018, 3:20 a.m. OK GNU C++11 TESTS 69 31 2662400 1700
42486838 high-cold D Sept. 5, 2018, 9:38 a.m. OK GNU C++11 TESTS 69 31 3174400 1700
41810733 cXs5 D Aug. 19, 2018, 2:51 a.m. OK GNU C++11 TESTS 69 31 3276800 1700
57167090 AyoAyowei D July 17, 2019, 12:08 a.m. OK GNU C++11 TESTS 69 31 3993600 1700
60516340 hehelego D Sept. 14, 2019, 6:46 a.m. OK GNU C++11 TESTS 69 31 10342400 1700
41809027 wangxuezhu D Aug. 19, 2018, 1:26 a.m. OK GNU C++11 TESTS 69 31 11468800 1700
65440003 910306264 D Nov. 20, 2019, 2:03 p.m. OK GNU C++11 TESTS 69 31 12492800 1700
46677053 wzj_xhjbk D Dec. 6, 2018, 10:19 a.m. OK GNU C++11 TESTS 69 31 13004800 1700
55086397 chenyewei_1234 D June 4, 2019, 12:43 p.m. OK GNU C++11 TESTS 69 31 13516800 1700
50080795 vjudge2 D Feb. 18, 2019, 3:46 a.m. OK GNU C++11 TESTS 69 31 13619200 1700
41803327 wleung_bvg D Aug. 18, 2018, 7:58 p.m. OK GNU C++14 TESTS 69 31 16486400 1700
41805711 wleung_bvg D Aug. 18, 2018, 9:35 p.m. OK GNU C++14 TESTS 69 46 16486400 1700
54578307 vjudge2 D May 25, 2019, 2:11 a.m. OK GNU C++14 TESTS 69 46 19251200 1700
41816052 Linkus D Aug. 19, 2018, 6:38 a.m. OK GNU C++14 TESTS 69 62 37683200 1700
48030659 gfonn D Jan. 6, 2019, 12:11 p.m. OK GNU C++14 TESTS 69 78 3174400 1700
41813319 yangshuang D Aug. 19, 2018, 5:01 a.m. OK GNU C++14 TESTS 69 93 2355200 1700
44941627 vjudge4 D Oct. 27, 2018, 8:05 a.m. OK GNU C++14 TESTS 69 93 2457600 1700
41828510 saathvik782 D Aug. 19, 2018, 1:23 p.m. OK GNU C++14 TESTS 69 93 2560000 1700
51401144 Heart_Blue D March 17, 2019, 7:25 a.m. OK GNU C++14 TESTS 69 93 3174400 1700
48447667 vjudge5 D Jan. 16, 2019, 8:23 a.m. OK GNU C++14 TESTS 69 93 3993600 1700
41976738 BagishovMikail D Aug. 22, 2018, 7:35 p.m. OK GNU C++17 TESTS 69 46 168345600 1700
41793574 Catmoonlight D Aug. 18, 2018, 4:32 p.m. OK GNU C++17 TESTS 69 61 15974400 1700
41990273 STRworld D Aug. 23, 2018, 8:25 a.m. OK GNU C++17 TESTS 69 78 3584000 1700
42023443 zumikua D Aug. 24, 2018, 10:48 a.m. OK GNU C++17 TESTS 69 93 2355200 1700
42705760 yifa D Sept. 9, 2018, 1:09 p.m. OK GNU C++17 TESTS 69 93 3584000 1700
41888346 tingpei D Aug. 20, 2018, 5:35 a.m. OK GNU C++17 TESTS 69 93 3584000 1700
45786188 CaNDidaTE_FaSTer D Nov. 16, 2018, 1:58 a.m. OK GNU C++17 TESTS 69 93 4300800 1700
41819946 Wake D Aug. 19, 2018, 9:02 a.m. OK GNU C++17 TESTS 69 93 9625600 1700
41799177 _Samir D Aug. 18, 2018, 5:52 p.m. OK GNU C++17 TESTS 69 93 15360000 1700
52028373 MMMMMMMW D March 30, 2019, 4:13 p.m. OK GNU C++17 TESTS 69 108 2457600 1700
43824145 achm D Oct. 5, 2018, 10:57 a.m. OK Go TESTS 69 124 23142400 1700
41904685 chandan5284 D Aug. 20, 2018, 1:58 p.m. OK Java 8 TESTS 69 124 0 1700
47377305 sooraj10 D Dec. 22, 2018, 6:14 p.m. OK Java 8 TESTS 69 124 0 1700
41866488 Aniket144 D Aug. 19, 2018, 5:15 p.m. OK Java 8 TESTS 69 139 7065600 1700
41903855 chandan5284 D Aug. 20, 2018, 1:33 p.m. OK Java 8 TESTS 69 140 0 1700
41804009 tanmay28 D Aug. 18, 2018, 8:21 p.m. OK Java 8 TESTS 69 140 0 1700
41794337 sarthakmanna D Aug. 18, 2018, 4:34 p.m. OK Java 8 TESTS 69 140 0 1700
41904084 chandan5284 D Aug. 20, 2018, 1:40 p.m. OK Java 8 TESTS 69 155 0 1700
41801574 ViciousCoder D Aug. 18, 2018, 7:01 p.m. OK Java 8 TESTS 69 155 13516800 1700
45981061 gil.vegliach D Nov. 19, 2018, 11:32 p.m. OK Java 8 TESTS 69 170 4710400 1700
45759572 Ahlea D Nov. 15, 2018, 8:14 a.m. OK Java 8 TESTS 69 170 10752000 1700
41807564 Bobko D Aug. 18, 2018, 11:27 p.m. OK Kotlin TESTS 69 748 48640000 1700
42688512 Javanochka D Sept. 8, 2018, 9:34 p.m. OK Kotlin TESTS 69 1029 121241600 1700
57438891 og.kostya D July 21, 2019, 6:05 a.m. OK Mono C# TESTS 69 62 36044800 1700
57438938 og.kostya D July 21, 2019, 6:06 a.m. OK Mono C# TESTS 69 77 6553600 1700
57438826 og.kostya D July 21, 2019, 6:04 a.m. OK Mono C# TESTS 69 78 69632000 1700
42192827 keep.deep D Aug. 28, 2018, 4:17 a.m. OK Mono C# TESTS 69 155 32358400 1700
41820362 YouAreTheBest D Aug. 19, 2018, 9:19 a.m. OK Mono C# TESTS 69 171 37785600 1700
55086476 vjudge5 D June 4, 2019, 12:45 p.m. OK MS C++ TESTS 69 46 9523200 1700
55019370 vjudge3 D June 3, 2019, 1:59 p.m. OK MS C++ TESTS 69 77 2457600 1700
58209564 monggo1995 D Aug. 3, 2019, 8:21 a.m. OK MS C++ TESTS 69 77 5836800 1700
58209974 echr D Aug. 3, 2019, 8:29 a.m. OK MS C++ TESTS 69 77 5836800 1700
54578082 vjudge2 D May 25, 2019, 1:55 a.m. OK MS C++ TESTS 69 77 20787200 1700
42611898 _mactep D Sept. 7, 2018, 11:33 a.m. OK MS C++ TESTS 69 78 2048000 1700
57822866 monggo1995 D July 27, 2019, 12:57 a.m. OK MS C++ TESTS 69 78 2457600 1700
42725336 vjudge2 D Sept. 10, 2018, 7:14 a.m. OK MS C++ TESTS 69 78 4198400 1700
57789582 1970966462 D July 26, 2019, 8:58 a.m. OK MS C++ TESTS 69 78 4198400 1700
58424286 1970966462 D Aug. 7, 2019, 9 a.m. OK MS C++ TESTS 69 78 4198400 1700
58499239 vjudge2 D Aug. 9, 2019, 1:31 p.m. OK MS C++ 2017 TESTS 69 124 3891200 1700
52568258 Still_Theory D April 10, 2019, 1:16 p.m. OK MS C++ 2017 TESTS 69 296 16179200 1700
63082745 CtrlAlt D Oct. 21, 2019, 3:38 p.m. OK MS C++ 2017 TESTS 69 311 4198400 1700
43636639 SerChirag D Oct. 1, 2018, 9:02 a.m. OK PyPy 2 TESTS 69 218 16179200 1700
42236326 YESMAths D Aug. 29, 2018, 9:55 a.m. OK PyPy 2 TESTS 69 233 14028800 1700
42092412 kd710306 D Aug. 25, 2018, 2:02 p.m. OK PyPy 2 TESTS 69 248 16998400 1700
41812878 ankit_06 D Aug. 19, 2018, 4:34 a.m. OK PyPy 2 TESTS 69 249 15155200 1700
41920533 supachai_pay D Aug. 21, 2018, 3:39 a.m. OK PyPy 2 TESTS 69 249 22937600 1700
46839958 Firepaw D Dec. 10, 2018, 6:45 a.m. OK PyPy 3 TESTS 69 358 20070400 1700
60244133 nagato1208 D Sept. 8, 2019, 12:29 a.m. OK PyPy 3 TESTS 69 452 19148800 1700
61980401 pineriver D Oct. 6, 2019, 11:49 a.m. OK PyPy 3 TESTS 69 452 20275200 1700
42318102 Skybytskyi.Nikita D Aug. 31, 2018, 6:48 p.m. OK PyPy 3 TESTS 69 498 32153600 1700
57127864 FlyingBag65 D July 16, 2019, 5:41 a.m. OK PyPy 3 TESTS 69 499 37888000 1700
41982974 nealzane D Aug. 23, 2018, 3:30 a.m. OK Python 2 TESTS 69 514 15360000 1700
41950638 wangkan2001 D Aug. 22, 2018, 12:49 a.m. OK Python 2 TESTS 69 546 15462400 1700
41827346 sallyyao2001 D Aug. 19, 2018, 12:45 p.m. OK Python 2 TESTS 69 561 15462400 1700
42150897 orailly D Aug. 27, 2018, 12:08 p.m. OK Python 3 TESTS 69 390 18534400 1700
53455062 vjudge1 D April 28, 2019, 1:30 a.m. OK Python 3 TESTS 69 405 18841600 1700
42104083 fascineted D Aug. 25, 2018, 9:54 p.m. OK Python 3 TESTS 69 420 18739200 1700
42104186 fascineted D Aug. 25, 2018, 10:01 p.m. OK Python 3 TESTS 69 421 18432000 1700
42149829 MadCoding D Aug. 27, 2018, 11:30 a.m. OK Python 3 TESTS 69 467 18636800 1700
41816120 messy_saurabh D Aug. 19, 2018, 6:40 a.m. OK Python 3 TESTS 69 498 18432000 1700
41962606 shaswat57 D Aug. 22, 2018, 10:22 a.m. OK Python 3 TESTS 69 514 18636800 1700
41958484 Denis10 D Aug. 22, 2018, 8:04 a.m. OK Python 3 TESTS 69 529 18022400 1700
41953297 Rockey D Aug. 22, 2018, 4:06 a.m. OK Python 3 TESTS 69 545 18636800 1700
41806141 Hi.Bitch D Aug. 18, 2018, 9:55 p.m. OK Python 3 TESTS 69 560 18534400 1700
41829134 AzureSXY D Aug. 19, 2018, 1:37 p.m. OK Rust TESTS 69 46 4915200 1700
42314212 vain0 D Aug. 31, 2018, 4:12 p.m. OK Rust TESTS 69 62 73318400 1700
41794187 vain0 D Aug. 18, 2018, 4:34 p.m. OK Rust TESTS 69 93 19456000 1700
42245119 yakamoto D Aug. 29, 2018, 2:48 p.m. OK Scala TESTS 69 608 10137600 1700

remove filters

Back to search problems