Codeforces Round 788 (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
1670 Codeforces Round 788 (Div. 2) FINISHED False 7200 85332263 May 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12880 ) B Dorms War PROGRAMMING brute force implementation strings 1100

B'Hosssam decided to sneak into Hemose 's room while he is sleeping and change his laptop 's password. He already knows the password, which is a string s of length n . He also knows that there are k special letters of the alphabet: c_1,c_2, ldots, c_k . Hosssam made a program that can do the following. For example, suppose the string s is "abcdef" and the special characters are 'b ' and 'd '. If he runs the program once, the positions 1 and 3 will be deleted as they come before special characters, so the password becomes "bdef". If he runs the program again, it deletes position 1 , and the password becomes "def". If he is wise, he won 't run it a third time. Hosssam wants to know how many times he can run the program on Hemose 's laptop without waking him up from the sound of the error message. Can you help him? The first line contains a single integer t ( 1 <= t <= 10^5 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains a single integer n ( 2 <= n <= 10^5 ) -- the initial length of the password. The next line contains a string s consisting of n lowercase English letters -- the initial password. The next line contains an integer k ( 1 <= k <= 26 ), followed by k distinct lowercase letters c_1,c_2, ldots,c_k -- the special letters. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print the maximum number of times Hosssam can run the program without displaying the error message, on a new line. In the first test case, the program can run 5 times as follows: text{iloveslim} to text{ilovslim} to text{iloslim} to text{ilslim} to text{islim} to text{slim} In the second test case, the program can run 2 times as follows: text{joobeel} to text{oel} to text{el} In the third test case, the program can run 3$'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156110045 AmooQ B May 6, 2022, 3:53 p.m. OK C# 8 TESTS 34 733 3993600 1100
156110712 NenadDapic B May 6, 2022, 3:55 p.m. OK FPC TESTS 34 561 204800 1100
156110633 zsa.sauran B May 6, 2022, 3:55 p.m. OK GNU C11 TESTS 34 452 102400 1100
156133207 YOK B May 6, 2022, 6:56 p.m. OK GNU C11 TESTS 34 592 102400 1100
156118571 keutoi B May 6, 2022, 4:23 p.m. OK GNU C11 TESTS 34 607 102400 1100
156117226 dougn711 B May 6, 2022, 4:18 p.m. OK GNU C11 TESTS 34 623 14233600 1100
156119888 Godwinner B May 6, 2022, 4:29 p.m. OK GNU C++14 TESTS 34 15 2662400 1100
156127157 chandler1837 B May 6, 2022, 5:49 p.m. OK GNU C++14 TESTS 34 77 409600 1100
156114893 sun_breathing B May 6, 2022, 4:10 p.m. OK GNU C++14 TESTS 34 77 819200 1100
156140506 maiky B May 6, 2022, 8:55 p.m. OK GNU C++14 TESTS 34 78 409600 1100
156140677 maiky B May 6, 2022, 8:58 p.m. OK GNU C++14 TESTS 34 92 409600 1100
156149785 Solitary_Walker B May 7, 2022, 1:49 a.m. OK GNU C++14 TESTS 34 93 102400 1100
156159134 hardy_9795 B May 7, 2022, 5:02 a.m. OK GNU C++14 TESTS 34 93 409600 1100
156147749 Mrinal_Kanti B May 7, 2022, 12:50 a.m. OK GNU C++14 TESTS 34 93 409600 1100
156132005 oceanic B May 6, 2022, 6:42 p.m. OK GNU C++14 TESTS 34 93 409600 1100
156159299 _AbRn_ B May 7, 2022, 5:05 a.m. OK GNU C++14 TESTS 34 93 409600 1100
156108896 ywjylx B May 6, 2022, 3:50 p.m. OK GNU C++17 TESTS 34 77 102400 1100
156111903 ssr1234 B May 6, 2022, 3:59 p.m. OK GNU C++17 TESTS 34 77 204800 1100
156139616 CrazyCoder00 B May 6, 2022, 8:37 p.m. OK GNU C++17 TESTS 34 77 409600 1100
156120658 shalekberli B May 6, 2022, 4:31 p.m. OK GNU C++17 TESTS 34 77 409600 1100
156157154 saivignesh_ad B May 7, 2022, 4:24 a.m. OK GNU C++17 TESTS 34 77 409600 1100
156152392 Taha B May 7, 2022, 2:47 a.m. OK GNU C++17 TESTS 34 77 409600 1100
156146954 jhc_123 B May 7, 2022, 12:23 a.m. OK GNU C++17 TESTS 34 77 17203200 1100
156125126 Ahmed_Mostafa11 B May 6, 2022, 5:31 p.m. OK GNU C++17 TESTS 34 78 409600 1100
156114049 yujingsea B May 6, 2022, 4:07 p.m. OK GNU C++17 TESTS 34 78 409600 1100
156148440 mayank-0141 B May 7, 2022, 1:12 a.m. OK GNU C++17 TESTS 34 92 409600 1100
156121363 Abd002 B May 6, 2022, 4:34 p.m. OK GNU C++17 (64) TESTS 34 46 409600 1100
156120605 Sakib62 B May 6, 2022, 4:31 p.m. OK GNU C++17 (64) TESTS 34 61 409600 1100
156142636 kennyleet B May 6, 2022, 9:44 p.m. OK GNU C++17 (64) TESTS 34 61 409600 1100
156142739 kennyleet B May 6, 2022, 9:47 p.m. OK GNU C++17 (64) TESTS 34 61 409600 1100
156146555 KunalSin9h B May 7, 2022, 12:07 a.m. OK GNU C++17 (64) TESTS 34 61 409600 1100
156158409 18o3 B May 7, 2022, 4:48 a.m. OK GNU C++17 (64) TESTS 34 61 409600 1100
156121077 Azusamitsusa B May 6, 2022, 4:33 p.m. OK GNU C++17 (64) TESTS 34 61 512000 1100
156124260 Timer_011 B May 6, 2022, 5:26 p.m. OK GNU C++17 (64) TESTS 34 61 614400 1100
156127002 Heisenberg_71 B May 6, 2022, 5:47 p.m. OK GNU C++17 (64) TESTS 34 61 2355200 1100
156150249 snailuu B May 7, 2022, 2 a.m. OK GNU C++17 (64) TESTS 34 61 2457600 1100
156127109 pseong B May 6, 2022, 5:48 p.m. OK GNU C++20 (64) TESTS 34 30 409600 1100
156118598 yukito8069 B May 6, 2022, 4:24 p.m. OK GNU C++20 (64) TESTS 34 31 921600 1100
156147144 ShivanshJ B May 7, 2022, 12:30 a.m. OK GNU C++20 (64) TESTS 34 46 102400 1100
156112386 Duc_Trong B May 6, 2022, 4:01 p.m. OK GNU C++20 (64) TESTS 34 46 307200 1100
156112824 ValiAntonie B May 6, 2022, 4:02 p.m. OK GNU C++20 (64) TESTS 34 46 307200 1100
156124817 Linkus B May 6, 2022, 5:29 p.m. OK GNU C++20 (64) TESTS 34 46 307200 1100
156151749 mibig B May 7, 2022, 2:34 a.m. OK GNU C++20 (64) TESTS 34 46 307200 1100
156156183 Asad5059 B May 7, 2022, 4:04 a.m. OK GNU C++20 (64) TESTS 34 46 409600 1100
156155048 Rinors B May 7, 2022, 3:41 a.m. OK GNU C++20 (64) TESTS 34 46 409600 1100
156160777 nirjhorJU B May 7, 2022, 5:30 a.m. OK GNU C++20 (64) TESTS 34 46 409600 1100
156132526 LXL B May 6, 2022, 6:48 p.m. OK Go TESTS 34 405 4915200 1100
156131889 koqo B May 6, 2022, 6:40 p.m. OK Go TESTS 34 436 4915200 1100
156150176 zelknow26 B May 7, 2022, 1:58 a.m. OK Go TESTS 34 888 5529600 1100
156150537 humwawe B May 7, 2022, 2:07 a.m. OK Java 11 TESTS 34 218 0 1100
156147518 EDCTY B May 7, 2022, 12:42 a.m. OK Java 11 TESTS 34 233 0 1100
156146969 Sandy_coder2001 B May 7, 2022, 12:23 a.m. OK Java 11 TESTS 34 233 0 1100
156111556 theanmolsharma B May 6, 2022, 3:58 p.m. OK Java 11 TESTS 34 248 0 1100
156159356 sf14t B May 7, 2022, 5:06 a.m. OK Java 11 TESTS 34 264 0 1100
156128663 Ma-XD B May 6, 2022, 6:04 p.m. OK Java 11 TESTS 34 264 0 1100
156124779 Halix B May 6, 2022, 5:29 p.m. OK Java 11 TESTS 34 265 0 1100
156133320 salanger B May 6, 2022, 6:58 p.m. OK Java 11 TESTS 34 280 0 1100
156117515 vamshisamineni3 B May 6, 2022, 4:19 p.m. OK Java 11 TESTS 34 280 0 1100
156132543 salanger B May 6, 2022, 6:48 p.m. OK Java 11 TESTS 34 296 0 1100
156118093 cftauros B May 6, 2022, 4:21 p.m. OK Java 8 TESTS 34 155 0 1100
156133826 satishkumary80 B May 6, 2022, 7:04 p.m. OK Java 8 TESTS 34 187 0 1100
156126602 gssakash B May 6, 2022, 5:43 p.m. OK Java 8 TESTS 34 202 0 1100
156118704 arpit31 B May 6, 2022, 4:24 p.m. OK Java 8 TESTS 34 202 0 1100
156113290 toufique_husein B May 6, 2022, 4:04 p.m. OK Java 8 TESTS 34 202 0 1100
156110643 cc4414 B May 6, 2022, 3:55 p.m. OK Java 8 TESTS 34 202 0 1100
156128794 ShivamMehta B May 6, 2022, 6:05 p.m. OK Java 8 TESTS 34 202 5734400 1100
156129553 Virendra115 B May 6, 2022, 6:13 p.m. OK Java 8 TESTS 34 217 0 1100
156139300 vaibhav_1710 B May 6, 2022, 8:31 p.m. OK Java 8 TESTS 34 233 0 1100
156117919 DoPractice B May 6, 2022, 4:21 p.m. OK Java 8 TESTS 34 233 0 1100
156115448 ryanberg B May 6, 2022, 4:12 p.m. OK Kotlin 1.5 TESTS 34 343 0 1100
156145660 thegeman B May 6, 2022, 11:32 p.m. OK Kotlin 1.6 TESTS 34 295 0 1100
156155803 ripity B May 7, 2022, 3:57 a.m. OK Kotlin 1.6 TESTS 34 452 19456000 1100
156109912 gryxon B May 6, 2022, 3:53 p.m. OK Kotlin 1.6 TESTS 34 936 614400 1100
156124046 De_nis B May 6, 2022, 5:25 p.m. OK MS C++ 2017 TESTS 34 202 3276800 1100
156116667 Neflibaty B May 6, 2022, 4:16 p.m. OK MS C++ 2017 TESTS 34 265 102400 1100
156120160 deyilhou B May 6, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 34 265 307200 1100
156148019 bhdtr B May 7, 2022, 12:59 a.m. OK MS C++ 2017 TESTS 34 280 307200 1100
156151987 ax020913 B May 7, 2022, 2:39 a.m. OK MS C++ 2017 TESTS 34 295 102400 1100
156126028 xsc B May 6, 2022, 5:38 p.m. OK MS C++ 2017 TESTS 34 358 307200 1100
156116635 jebi_jok B May 6, 2022, 4:16 p.m. OK MS C++ 2017 TESTS 34 389 512000 1100
156110005 hyp0crite152 B May 6, 2022, 3:53 p.m. OK MS C++ 2017 TESTS 34 670 1126400 1100
156110742 sushanta B May 6, 2022, 3:55 p.m. OK MS C++ 2017 TESTS 34 764 4096000 1100
156109896 Enternal B May 6, 2022, 3:53 p.m. OK MS C++ 2017 TESTS 34 780 1126400 1100
156118307 osato B May 6, 2022, 4:22 p.m. OK Node.js TESTS 34 857 15974400 1100
156158730 yoralbayev B May 7, 2022, 4:54 a.m. OK PHP TESTS 34 951 614400 1100
156113760 conqueror_of_titia B May 6, 2022, 4:06 p.m. OK PyPy 2 TESTS 34 280 14745600 1100
156124613 1_2_3_4_5_9 B May 6, 2022, 5:28 p.m. OK PyPy 2 TESTS 34 327 14540800 1100
156128175 ifte104 B May 6, 2022, 5:59 p.m. OK PyPy 3 TESTS 34 248 16076800 1100
156129284 jano31415 B May 6, 2022, 6:10 p.m. OK PyPy 3 TESTS 34 343 13312000 1100
156124676 FrozenKandy B May 6, 2022, 5:28 p.m. OK PyPy 3 TESTS 34 421 8908800 1100
156113387 explodingfrost B May 6, 2022, 4:04 p.m. OK PyPy 3 TESTS 34 421 8908800 1100
156160282 rainap B May 7, 2022, 5:21 a.m. OK PyPy 3 TESTS 34 467 9932800 1100
156127229 ifte104 B May 6, 2022, 5:49 p.m. OK PyPy 3 TESTS 34 545 9830400 1100
156125710 worldsaver B May 6, 2022, 5:36 p.m. OK PyPy 3 TESTS 34 545 13209600 1100
156132640 mrSTARK007 B May 6, 2022, 6:50 p.m. OK PyPy 3 TESTS 34 561 9830400 1100
156125496 worldsaver B May 6, 2022, 5:34 p.m. OK PyPy 3 TESTS 34 561 13209600 1100
156129057 sunny_kr B May 6, 2022, 6:08 p.m. OK PyPy 3 TESTS 34 576 10342400 1100
156128641 ifte104 B May 6, 2022, 6:03 p.m. OK PyPy 3-64 TESTS 34 202 14540800 1100
156150321 rivnam B May 7, 2022, 2:02 a.m. OK PyPy 3-64 TESTS 34 218 13619200 1100
156146748 jerwu B May 7, 2022, 12:14 a.m. OK PyPy 3-64 TESTS 34 233 14438400 1100
156111671 Yinch B May 6, 2022, 3:58 p.m. OK PyPy 3-64 TESTS 34 234 15052800 1100
156127117 nitish420 B May 6, 2022, 5:48 p.m. OK PyPy 3-64 TESTS 34 249 21094400 1100
156130873 pratyanch_jain B May 6, 2022, 6:27 p.m. OK PyPy 3-64 TESTS 34 280 15769600 1100
156110678 tushar26427 B May 6, 2022, 3:55 p.m. OK PyPy 3-64 TESTS 34 405 15052800 1100
156136221 tyzzi B May 6, 2022, 7:38 p.m. OK PyPy 3-64 TESTS 34 436 16486400 1100
156109546 TheViking733n B May 6, 2022, 3:52 p.m. OK PyPy 3-64 TESTS 34 436 17203200 1100
156145413 sharingan000 B May 6, 2022, 11:21 p.m. OK PyPy 3-64 TESTS 34 483 10547200 1100
156115648 Jimanbanashi B May 6, 2022, 4:13 p.m. OK Python 2 TESTS 34 483 4812800 1100
156115036 Ghulam_Junaid B May 6, 2022, 4:10 p.m. OK Python 3 TESTS 34 483 1740800 1100
156108895 jinhwanlazy B May 6, 2022, 3:50 p.m. OK Python 3 TESTS 34 514 2867200 1100
156148347 Eguy B May 7, 2022, 1:09 a.m. OK Python 3 TESTS 34 624 1740800 1100
156115591 pirate0 B May 6, 2022, 4:12 p.m. OK Python 3 TESTS 34 685 3174400 1100
156128626 Amay12 B May 6, 2022, 6:03 p.m. OK Python 3 TESTS 34 701 512000 1100
156150028 Muhammad.Daniyal B May 7, 2022, 1:55 a.m. OK Python 3 TESTS 34 764 2764800 1100
156112765 rostoki B May 6, 2022, 4:02 p.m. OK Python 3 TESTS 34 764 15052800 1100
156128248 ifte104 B May 6, 2022, 6 p.m. OK Python 3 TESTS 34 842 512000 1100
156137327 tejassoni9998 B May 6, 2022, 7:55 p.m. OK Python 3 TESTS 34 904 716800 1100
156116281 Narzullayev.S B May 6, 2022, 4:15 p.m. OK Python 3 TESTS 34 935 2048000 1100

remove filters

Back to search problems