Codeforces Round 624 (Div. 3)

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
1311 Codeforces Round 624 (Div. 3) FINISHED False 7200 149268299 Feb. 24, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16075 ) C Perform the Combo PROGRAMMING brute force 1300

B'You want to perform the combo on your opponent in one popular fighting game. The combo is the string s consisting of n lowercase Latin letters. To perform the combo, you have to press all buttons in the order they appear in s . I.e. if s= "abca" then you have to press 'a ', then 'b ', 'c ' and 'a ' again. You know that you will spend m wrong tries to perform the combo and during the i -th try you will make a mistake right after p_i -th button ( 1 <= p_i < n ) (i.e. you will press first p_i buttons right and start performing the combo from the beginning). It is guaranteed that during the m+1 -th try you press all buttons right and finally perform the combo. I.e. if s= "abca", m=2 and p = [1, 3] then the sequence of pressed buttons will be 'a ' (here you 're making a mistake and start performing the combo from the beginning), 'a ', 'b ', 'c ', (here you 're making a mistake and start performing the combo from the beginning), 'a ' (note that at this point you will not perform the combo because of the mistake), 'b ', 'c ', 'a '. Your task is to calculate for each button (letter) the number of times you 'll press it. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains two integers n and m ( 2 <= n <= 2 cdot 10^5 , 1 <= m <= 2 cdot 10^5 ) -- the length of s and the number of tries correspondingly. The second line of each test case contains the string s consisting of n lowercase Latin letters. The third line of each test case contains m integers p_1, p_2, ... , p_m ( 1 <= p_i < n ) -- the number of characters pressed right during the i -th try. It is guaranteed that the sum of n and the sum of m both does not exceed 2 cdot 10^5 ( sum n '...

Tutorials

74224

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
71833674 ftiasch C Feb. 25, 2020, 4:26 a.m. OK D TESTS 8 109 11571200 1300
71785942 iica C Feb. 24, 2020, 3:10 p.m. OK D TESTS 8 139 11673600 1300
71783463 daut-dlang C Feb. 24, 2020, 3:03 p.m. OK D TESTS 8 171 125542400 1300
71812158 denchik007orel57 C Feb. 24, 2020, 5:01 p.m. OK Delphi TESTS 8 124 2048000 1300
71781429 ruban C Feb. 24, 2020, 2:58 p.m. OK Delphi TESTS 8 187 111308800 1300
71790930 denchik007orel57 C Feb. 24, 2020, 3:24 p.m. OK FPC TESTS 8 795 2150400 1300
71792311 Samsara_soul C Feb. 24, 2020, 3:28 p.m. OK FPC TESTS 8 841 20889600 1300
71791482 PAG C Feb. 24, 2020, 3:26 p.m. OK FPC TESTS 8 873 22220800 1300
71844677 atillaqun C Feb. 25, 2020, 8:46 a.m. OK GNU C11 TESTS 8 826 1024000 1300
71796612 Fretzo C Feb. 24, 2020, 3:43 p.m. OK GNU C11 TESTS 8 826 20992000 1300
71802406 jschr C Feb. 24, 2020, 4:06 p.m. OK GNU C11 TESTS 8 826 20992000 1300
71781357 pengin_2000 C Feb. 24, 2020, 2:58 p.m. OK GNU C11 TESTS 8 841 1843200 1300
71812375 kaiboy C Feb. 24, 2020, 5:04 p.m. OK GNU C11 TESTS 8 842 1024000 1300
71808671 Kelvin11 C Feb. 24, 2020, 4:32 p.m. OK GNU C11 TESTS 8 858 1740800 1300
71815895 Beku.sh C Feb. 24, 2020, 5:53 p.m. OK GNU C11 TESTS 8 858 1740800 1300
71801912 Dhruv2506 C Feb. 24, 2020, 4:04 p.m. OK GNU C11 TESTS 8 858 20992000 1300
71795794 rainboy C Feb. 24, 2020, 3:40 p.m. OK GNU C11 TESTS 8 873 1024000 1300
71797661 romarioputra C Feb. 24, 2020, 3:47 p.m. OK GNU C11 TESTS 8 873 1740800 1300
71790134 z7z_Eta C Feb. 24, 2020, 3:22 p.m. OK GNU C++11 TESTS 8 46 819200 1300
71908237 luogu_bot5 C Feb. 26, 2020, 10:49 a.m. OK GNU C++11 TESTS 8 46 2662400 1300
71832253 MasonMount19 C Feb. 25, 2020, 3:36 a.m. OK GNU C++11 TESTS 8 46 2662400 1300
71784707 IjfcnyaIi C Feb. 24, 2020, 3:06 p.m. OK GNU C++11 TESTS 8 46 3379200 1300
71794291 wyy2004 C Feb. 24, 2020, 3:35 p.m. OK GNU C++11 TESTS 8 46 21811200 1300
71800747 Watson_2020 C Feb. 24, 2020, 3:59 p.m. OK GNU C++11 TESTS 8 46 22425600 1300
71784459 hkr04 C Feb. 24, 2020, 3:06 p.m. OK GNU C++11 TESTS 8 61 2457600 1300
71898734 gyh20 C Feb. 26, 2020, 6:51 a.m. OK GNU C++11 TESTS 8 61 21094400 1300
71888797 TYGZ C Feb. 26, 2020, 12:21 a.m. OK GNU C++11 TESTS 8 61 21094400 1300
71892341 luogu_bot5 C Feb. 26, 2020, 3:16 a.m. OK GNU C++11 TESTS 8 61 24268800 1300
71903643 EatingMelonPublic C Feb. 26, 2020, 9:05 a.m. OK GNU C++14 TESTS 8 62 1024000 1300
71782449 shdut0901 C Feb. 24, 2020, 3:01 p.m. OK GNU C++14 TESTS 8 62 1024000 1300
71844654 opsopsops1 C Feb. 25, 2020, 8:45 a.m. OK GNU C++14 TESTS 8 62 1331200 1300
71789156 213ddi C Feb. 24, 2020, 3:19 p.m. OK GNU C++14 TESTS 8 62 1843200 1300
71925206 ateev_mishra7 C Feb. 26, 2020, 3:59 p.m. OK GNU C++14 TESTS 8 62 2150400 1300
71781629 Hossam.Yehia C Feb. 24, 2020, 2:59 p.m. OK GNU C++14 TESTS 8 77 1024000 1300
71812033 racsosabe C Feb. 24, 2020, 5 p.m. OK GNU C++14 TESTS 8 77 1024000 1300
71802064 swapnil_a01 C Feb. 24, 2020, 4:05 p.m. OK GNU C++14 TESTS 8 77 1331200 1300
71898674 ctuu C Feb. 26, 2020, 6:50 a.m. OK GNU C++14 TESTS 8 77 1331200 1300
71798859 boruto03 C Feb. 24, 2020, 3:52 p.m. OK GNU C++14 TESTS 8 77 1331200 1300
71891271 _andyli C Feb. 26, 2020, 2:30 a.m. OK GNU C++17 TESTS 8 31 3891200 1300
71789782 _andyli C Feb. 24, 2020, 3:20 p.m. OK GNU C++17 TESTS 8 46 3891200 1300
71788964 CUSTStein C Feb. 24, 2020, 3:18 p.m. OK GNU C++17 TESTS 8 62 1024000 1300
71791511 _____JONTRONA_____ C Feb. 24, 2020, 3:26 p.m. OK GNU C++17 TESTS 8 62 1331200 1300
71844114 challenger128 C Feb. 25, 2020, 8:33 a.m. OK GNU C++17 TESTS 8 62 2150400 1300
71866728 ChandVachhani_ C Feb. 25, 2020, 3:01 p.m. OK GNU C++17 TESTS 8 62 2150400 1300
71900076 MaJorie C Feb. 26, 2020, 7:25 a.m. OK GNU C++17 TESTS 8 77 1024000 1300
71928178 Kenzo1114 C Feb. 26, 2020, 4:49 p.m. OK GNU C++17 TESTS 8 77 1024000 1300
71887359 reasoned_nuance ChrisT Ninjaclasher C Feb. 25, 2020, 11:04 p.m. OK GNU C++17 TESTS 8 77 1024000 1300
71882180 Rund.Rasheed C Feb. 25, 2020, 8:01 p.m. OK GNU C++17 TESTS 8 77 1024000 1300
71893933 iHackSubhodip C Feb. 26, 2020, 4:11 a.m. OK Go TESTS 8 889 4505600 1300
71842795 farmerboy C Feb. 25, 2020, 8:04 a.m. OK Go TESTS 8 889 5836800 1300
71893777 iHackSubhodip C Feb. 26, 2020, 4:07 a.m. OK Go TESTS 8 904 4505600 1300
71802459 snow_bear_328 C Feb. 24, 2020, 4:06 p.m. OK Go TESTS 8 919 14131200 1300
71791850 j31d0 C Feb. 24, 2020, 3:27 p.m. OK Haskell TESTS 8 826 44236800 1300
71864121 Azakarka C Feb. 25, 2020, 2:22 p.m. OK Java 11 TESTS 8 233 0 1300
71934768 alae C Feb. 26, 2020, 7:02 p.m. OK Java 11 TESTS 8 234 0 1300
71874339 Anonymous C Feb. 25, 2020, 5:13 p.m. OK Java 11 TESTS 8 234 0 1300
71791453 Oom C Feb. 24, 2020, 3:26 p.m. OK Java 11 TESTS 8 234 0 1300
71789795 sajith C Feb. 24, 2020, 3:21 p.m. OK Java 11 TESTS 8 248 0 1300
71852425 ZeyadKhattab C Feb. 25, 2020, 11:20 a.m. OK Java 11 TESTS 8 249 0 1300
71786579 mikkk C Feb. 24, 2020, 3:12 p.m. OK Java 11 TESTS 8 249 0 1300
71785108 pikapika00 C Feb. 24, 2020, 3:08 p.m. OK Java 11 TESTS 8 249 0 1300
71784753 GiantTornado C Feb. 24, 2020, 3:07 p.m. OK Java 11 TESTS 8 280 0 1300
71807697 sarthak.0702 C Feb. 24, 2020, 4:28 p.m. OK Java 11 TESTS 8 280 15769600 1300
71791341 arsh1598 C Feb. 24, 2020, 3:25 p.m. OK Java 8 TESTS 8 124 0 1300
71920372 niketan C Feb. 26, 2020, 2:35 p.m. OK Java 8 TESTS 8 139 0 1300
71788000 Ad-007 C Feb. 24, 2020, 3:15 p.m. OK Java 8 TESTS 8 139 0 1300
71781083 aman28rwt C Feb. 24, 2020, 2:57 p.m. OK Java 8 TESTS 8 139 0 1300
71788278 anony9906 C Feb. 24, 2020, 3:16 p.m. OK Java 8 TESTS 8 139 1126400 1300
71817286 garg_vibhor C Feb. 24, 2020, 6:18 p.m. OK Java 8 TESTS 8 139 1536000 1300
71851674 shahdhairya678 C Feb. 25, 2020, 11:07 a.m. OK Java 8 TESTS 8 140 0 1300
71828348 A5SAS51N C Feb. 25, 2020, 12:44 a.m. OK Java 8 TESTS 8 140 0 1300
71800589 manishjha221 C Feb. 24, 2020, 3:58 p.m. OK Java 8 TESTS 8 140 0 1300
71795333 pc_wallace C Feb. 24, 2020, 3:38 p.m. OK Java 8 TESTS 8 140 0 1300
71882074 Carlos C Feb. 25, 2020, 7:58 p.m. OK JavaScript TESTS 8 202 26419200 1300
71946383 jhonber C Feb. 27, 2020, 2:13 a.m. OK JavaScript TESTS 8 233 26112000 1300
71946544 jhonber C Feb. 27, 2020, 2:20 a.m. OK JavaScript TESTS 8 264 36864000 1300
71824279 jhonber C Feb. 24, 2020, 9:23 p.m. OK JavaScript TESTS 8 1076 62259200 1300
71795150 watarimaycry2 C Feb. 24, 2020, 3:38 p.m. OK JavaScript TESTS 8 1606 48435200 1300
71948385 Benq C Feb. 27, 2020, 3:29 a.m. OK Kotlin TESTS 8 155 1228800 1300
71782842 avm C Feb. 24, 2020, 3:02 p.m. OK Kotlin TESTS 8 202 19353600 1300
71862109 Spheniscine C Feb. 25, 2020, 1:52 p.m. OK Kotlin TESTS 8 218 29696000 1300
71914843 yakamoto C Feb. 26, 2020, 12:56 p.m. OK Kotlin TESTS 8 280 69836800 1300
71779338 YESMAths C Feb. 24, 2020, 2:53 p.m. OK Kotlin TESTS 8 295 13004800 1300
71813121 YESMAths C Feb. 24, 2020, 5:13 p.m. OK Kotlin TESTS 8 296 13004800 1300
71782915 rhincodon66 C Feb. 24, 2020, 3:02 p.m. OK Kotlin TESTS 8 389 39424000 1300
71948751 pr3pony C Feb. 27, 2020, 3:44 a.m. OK Kotlin TESTS 8 405 66457600 1300
71814652 SlavaG C Feb. 24, 2020, 5:34 p.m. OK Kotlin TESTS 8 452 40652800 1300
71789465 HanaYukii C Feb. 24, 2020, 3:20 p.m. OK Kotlin TESTS 8 561 63180800 1300
71785381 T-D-K C Feb. 24, 2020, 3:08 p.m. OK Mono C# TESTS 8 78 3174400 1300
71791107 riantkb C Feb. 24, 2020, 3:25 p.m. OK Mono C# TESTS 8 124 22425600 1300
71779549 mban259 C Feb. 24, 2020, 2:54 p.m. OK Mono C# TESTS 8 139 21606400 1300
71965983 suslov93 C Feb. 27, 2020, 10:37 a.m. OK Mono C# TESTS 8 186 42700800 1300
71807863 faxse C Feb. 24, 2020, 4:29 p.m. OK Mono C# TESTS 8 217 37683200 1300
71944237 shy3205 C Feb. 27, 2020, 12:25 a.m. OK Mono C# TESTS 8 218 28774400 1300
71804928 Anastasiya_Andreevna C Feb. 24, 2020, 4:16 p.m. OK Mono C# TESTS 8 342 64716800 1300
71816202 korntest C Feb. 24, 2020, 5:58 p.m. OK Mono C# TESTS 8 982 61440000 1300
71790542 leesiwon C Feb. 24, 2020, 3:23 p.m. OK MS C++ TESTS 8 78 1024000 1300
71915580 vjudge1 C Feb. 26, 2020, 1:10 p.m. OK MS C++ TESTS 8 78 24268800 1300
71897072 vjudge2 C Feb. 26, 2020, 6:06 a.m. OK MS C++ TESTS 8 78 25088000 1300
71914938 vjudge1 C Feb. 26, 2020, 12:58 p.m. OK MS C++ TESTS 8 93 24268800 1300
71816278 vjudge5 C Feb. 24, 2020, 6 p.m. OK MS C++ TESTS 8 233 22323200 1300
71802513 tranthanhtra C Feb. 24, 2020, 4:07 p.m. OK MS C++ TESTS 8 264 2048000 1300
71802365 k.arora C Feb. 24, 2020, 4:06 p.m. OK MS C++ TESTS 8 265 1843200 1300
71800587 DLUTteng C Feb. 24, 2020, 3:58 p.m. OK MS C++ TESTS 8 529 1638400 1300
71793236 godovald C Feb. 24, 2020, 3:31 p.m. OK MS C++ TESTS 8 592 3584000 1300
71784614 danilgrig C Feb. 24, 2020, 3:06 p.m. OK MS C++ TESTS 8 748 176537600 1300
71807303 Alpaca00 C Feb. 24, 2020, 4:27 p.m. OK MS C++ 2017 TESTS 8 109 1024000 1300
71785037 Conan73 C Feb. 24, 2020, 3:07 p.m. OK MS C++ 2017 TESTS 8 109 1843200 1300
71795601 Hello_orz C Feb. 24, 2020, 3:39 p.m. OK MS C++ 2017 TESTS 8 109 1945600 1300
71792763 Voz56 C Feb. 24, 2020, 3:30 p.m. OK MS C++ 2017 TESTS 8 109 2252800 1300
71870583 spln C Feb. 25, 2020, 4:06 p.m. OK MS C++ 2017 TESTS 8 124 1024000 1300
71789905 15880711007 C Feb. 24, 2020, 3:21 p.m. OK MS C++ 2017 TESTS 8 124 1945600 1300
71786367 kim_young_hyun C Feb. 24, 2020, 3:11 p.m. OK MS C++ 2017 TESTS 8 124 1945600 1300
71779749 youx C Feb. 24, 2020, 2:54 p.m. OK MS C++ 2017 TESTS 8 140 21196800 1300
71806151 gjdms611 C Feb. 24, 2020, 4:22 p.m. OK MS C++ 2017 TESTS 8 140 21913600 1300
71789338 fucking_man C Feb. 24, 2020, 3:19 p.m. OK MS C++ 2017 TESTS 8 202 1843200 1300
71806534 badawhite C Feb. 24, 2020, 4:23 p.m. OK Node.js TESTS 8 373 15462400 1300
71798795 klond90 C Feb. 24, 2020, 3:52 p.m. OK Node.js TESTS 8 389 14336000 1300
71799489 shivam1420 C Feb. 24, 2020, 3:54 p.m. OK Node.js TESTS 8 452 52940800 1300
71796030 deskata1997 C Feb. 24, 2020, 3:41 p.m. OK Node.js TESTS 8 1138 15667200 1300
71788304 rsFalse C Feb. 24, 2020, 3:16 p.m. OK Perl TESTS 8 389 33894400 1300
71961117 mayakin C Feb. 27, 2020, 9:01 a.m. OK PHP TESTS 8 467 43724800 1300
71847268 Kiral55 C Feb. 25, 2020, 9:39 a.m. OK PHP TESTS 8 936 26931200 1300
71798912 Gaurav1 C Feb. 24, 2020, 3:52 p.m. OK PyPy 2 TESTS 8 249 15564800 1300
71779955 pajenegod C Feb. 24, 2020, 2:55 p.m. OK PyPy 2 TESTS 8 265 18227200 1300
71794903 bazzyadb C Feb. 24, 2020, 3:37 p.m. OK PyPy 2 TESTS 8 452 34201600 1300
71785524 rkstalker C Feb. 24, 2020, 3:09 p.m. OK PyPy 2 TESTS 8 623 20172800 1300
71783425 anshuman16423 C Feb. 24, 2020, 3:03 p.m. OK PyPy 2 TESTS 8 1590 12390400 1300
71781876 raj1307 C Feb. 24, 2020, 2:59 p.m. OK PyPy 3 TESTS 8 249 15564800 1300
71788755 tachyon777 C Feb. 24, 2020, 3:18 p.m. OK PyPy 3 TESTS 8 311 15872000 1300
71779583 DarkYagami C Feb. 24, 2020, 2:54 p.m. OK PyPy 3 TESTS 8 312 39116800 1300
71819304 apoorvwatsky C Feb. 24, 2020, 7 p.m. OK PyPy 3 TESTS 8 327 17305600 1300
71813713 Whitehat010 C Feb. 24, 2020, 5:21 p.m. OK PyPy 3 TESTS 8 342 16179200 1300
71797165 suchet0825 C Feb. 24, 2020, 3:45 p.m. OK PyPy 3 TESTS 8 343 15360000 1300
71808189 diffeo C Feb. 24, 2020, 4:30 p.m. OK PyPy 3 TESTS 8 358 21401600 1300
71786119 nagitaosu C Feb. 24, 2020, 3:10 p.m. OK PyPy 3 TESTS 8 374 15564800 1300
71788848 aberent C Feb. 24, 2020, 3:18 p.m. OK PyPy 3 TESTS 8 374 18022400 1300
71794033 Parag_AP C Feb. 24, 2020, 3:34 p.m. OK PyPy 3 TESTS 8 374 20480000 1300
71802402 resita C Feb. 24, 2020, 4:06 p.m. OK Python 2 TESTS 8 436 11264000 1300
71793165 anil_vemula C Feb. 24, 2020, 3:31 p.m. OK Python 2 TESTS 8 576 11571200 1300
71782994 r57shell C Feb. 24, 2020, 3:02 p.m. OK Python 3 TESTS 8 358 14643200 1300
71800798 qfxrsnkbg C Feb. 24, 2020, 3:59 p.m. OK Python 3 TESTS 8 452 14745600 1300
71793288 orazbek C Feb. 24, 2020, 3:31 p.m. OK Python 3 TESTS 8 498 18534400 1300
71859764 Achilles221B C Feb. 25, 2020, 1:17 p.m. OK Python 3 TESTS 8 514 14131200 1300
71784917 Pierroteknik C Feb. 24, 2020, 3:07 p.m. OK Python 3 TESTS 8 514 16486400 1300
71819840 tnowakow C Feb. 24, 2020, 7:12 p.m. OK Python 3 TESTS 8 529 14540800 1300
71804110 pangeranbhp C Feb. 24, 2020, 4:13 p.m. OK Python 3 TESTS 8 529 16588800 1300
71881621 LionCheetah C Feb. 25, 2020, 7:48 p.m. OK Python 3 TESTS 8 545 14540800 1300
71796971 garrycussoy C Feb. 24, 2020, 3:44 p.m. OK Python 3 TESTS 8 561 14745600 1300
71792673 mkawa2 C Feb. 24, 2020, 3:29 p.m. OK Python 3 TESTS 8 576 14745600 1300
71788661 akiradeveloper C Feb. 24, 2020, 3:17 p.m. OK Rust TESTS 8 171 127488000 1300
71799103 toterpinguin C Feb. 24, 2020, 3:53 p.m. OK Rust TESTS 8 186 52326400 1300
71824382 clearlycloudy C Feb. 24, 2020, 9:27 p.m. OK Rust TESTS 8 202 27238400 1300
71788838 manta1130 C Feb. 24, 2020, 3:18 p.m. OK Rust TESTS 8 233 31232000 1300
71795178 mversic101 C Feb. 24, 2020, 3:38 p.m. OK Rust TESTS 8 358 90726400 1300

remove filters

Back to search problems