Codeforces Round 903 (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
1881 Codeforces Round 903 (Div. 3) FINISHED False 8100 40058663 Oct. 12, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 34627 ) A Don't Try to Count PROGRAMMING brute force strings

B'Given a string x of length n and a string s of length m ( n cdot m <= 25 ), consisting of lowercase Latin letters, you can apply any number of operations to the string x . In one operation, you append the current value of x to the end of the string x . Note that the value of x will change after this. For example, if x = "aba", then after applying operations, x will change as follows: "aba" rightarrow "abaaba" rightarrow "abaabaabaaba". After what minimum number of operations s will appear in x as a substring? A substring of a string is defined as a contiguous segment of it. The first line of the input contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two numbers n and m ( 1 <= n cdot m <= 25 ) -- the lengths of strings x and s , respectively. The second line of each test case contains the string x of length n . The third line of each test case contains the string s of length m . For each test case, output a single number -- the minimum number of operations after which s will appear in x as a substring. If this is not possible, output -1 . In the first test case of the example, after 2 operations, the string will become "aaaa", and after 3 operations, it will become "aaaaaaaa", so the answer is 3 . In the second test case of the example, after applying 1 operation, the string will become " text{e} color{red}{ text{force}} text{forc} ", where the substring is highlighted in red. In the fourth test case of the example, it can be shown that it is impossible to obtain the desired string as a substring. '...

Tutorials

121327

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
227958325 Sharpyn_Elmor A Oct. 12, 2023, 10:57 p.m. OK C# 10 TESTS 4 46 3072000
227943956 Derato A Oct. 12, 2023, 7:07 p.m. OK C# 10 TESTS 4 46 3788800
227957819 Sharpyn_Elmor A Oct. 12, 2023, 10:44 p.m. OK C# 10 TESTS 4 61 3072000
227929668 Shahanov_Danylo A Oct. 12, 2023, 5:11 p.m. OK C# 10 TESTS 4 93 2867200
227958423 bluemegane A Oct. 12, 2023, 11 p.m. OK C# 8 TESTS 4 233 3276800
227980649 zhibaiyun A Oct. 13, 2023, 5:40 a.m. OK Clang++17 Diagnostics TESTS 4 187 0
227967862 m_math A Oct. 13, 2023, 2:37 a.m. OK Clang++17 Diagnostics TESTS 4 264 12595200
227940912 Hemanth.t A Oct. 12, 2023, 6:37 p.m. OK Clang++20 Diagnostics TESTS 4 62 0
227931375 OUyio A Oct. 12, 2023, 5:21 p.m. OK Clang++20 Diagnostics TESTS 4 140 1024000
227968591 yui-v- A Oct. 13, 2023, 2:49 a.m. OK Clang++20 Diagnostics TESTS 4 155 1024000
227968627 yui-v- A Oct. 13, 2023, 2:49 a.m. OK Clang++20 Diagnostics TESTS 4 155 10444800
227936202 catchfree1225 A Oct. 12, 2023, 5:57 p.m. OK Clang++20 Diagnostics TESTS 4 202 2048000
227967849 kaliIsDancing A Oct. 13, 2023, 2:37 a.m. OK Clang++20 Diagnostics TESTS 4 311 18944000
227964412 kirito_solo A Oct. 13, 2023, 1:33 a.m. OK Clang++20 Diagnostics TESTS 4 390 18944000
227978571 NeNe1 A Oct. 13, 2023, 5:16 a.m. OK Clang++20 Diagnostics TESTS 4 919 204800
227956417 JKJeong A Oct. 12, 2023, 10:08 p.m. OK FPC TESTS 4 62 204800
227928888 yuzhouyz A Oct. 12, 2023, 5:07 p.m. OK GNU C11 TESTS 4 46 0
227943236 HadesKraken A Oct. 12, 2023, 6:59 p.m. OK GNU C11 TESTS 4 46 0
227973558 akurai A Oct. 13, 2023, 4:05 a.m. OK GNU C11 TESTS 4 46 0
227976213 yuzhouyz A Oct. 13, 2023, 4:44 a.m. OK GNU C11 TESTS 4 46 0
227976400 yuzhouyz A Oct. 13, 2023, 4:47 a.m. OK GNU C11 TESTS 4 46 0
227977155 mdadnan A Oct. 13, 2023, 4:57 a.m. OK GNU C11 TESTS 4 46 0
227977480 beatmeloser A Oct. 13, 2023, 5:02 a.m. OK GNU C11 TESTS 4 46 0
227979709 turjooo A Oct. 13, 2023, 5:30 a.m. OK GNU C11 TESTS 4 61 0
227960816 magyoumi A Oct. 13, 2023, 12:09 a.m. OK GNU C11 TESTS 4 62 0
227974258 zubaer.mahmud31 A Oct. 13, 2023, 4:16 a.m. OK GNU C11 TESTS 4 62 0
227925809 Orange_Ice A Oct. 12, 2023, 4:55 p.m. OK GNU C++14 TESTS 4 15 0
227974453 Bishal_1 A Oct. 13, 2023, 4:19 a.m. OK GNU C++14 TESTS 4 15 0
227969745 beanomahto A Oct. 13, 2023, 3:09 a.m. OK GNU C++14 TESTS 4 15 0
227969718 HashBuke A Oct. 13, 2023, 3:08 a.m. OK GNU C++14 TESTS 4 15 0
227963590 abcDDdddd A Oct. 13, 2023, 1:17 a.m. OK GNU C++14 TESTS 4 15 0
227954365 omeganot A Oct. 12, 2023, 9:25 p.m. OK GNU C++14 TESTS 4 15 0
227932890 Bojji_Kage A Oct. 12, 2023, 5:31 p.m. OK GNU C++14 TESTS 4 15 0
227926674 marobartczak A Oct. 12, 2023, 4:58 p.m. OK GNU C++14 TESTS 4 15 0
227975775 itsme_pranetha A Oct. 13, 2023, 4:39 a.m. OK GNU C++14 TESTS 4 15 102400
227977742 hack41 A Oct. 13, 2023, 5:05 a.m. OK GNU C++14 TESTS 4 15 102400
227982503 Himel02 A Oct. 13, 2023, 6 a.m. OK GNU C++17 TESTS 4 15 0
227975983 Beast_376 A Oct. 13, 2023, 4:41 a.m. OK GNU C++17 TESTS 4 15 0
227976289 Code4FreakingFun A Oct. 13, 2023, 4:46 a.m. OK GNU C++17 TESTS 4 15 0
227977579 me_tamilselvan A Oct. 13, 2023, 5:03 a.m. OK GNU C++17 TESTS 4 15 0
227978316 pinku_strives A Oct. 13, 2023, 5:12 a.m. OK GNU C++17 TESTS 4 15 0
227978416 HatureyCoder A Oct. 13, 2023, 5:14 a.m. OK GNU C++17 TESTS 4 15 0
227979310 GGodSSpeed A Oct. 13, 2023, 5:25 a.m. OK GNU C++17 TESTS 4 15 0
227979703 kushwanth_sistu A Oct. 13, 2023, 5:29 a.m. OK GNU C++17 TESTS 4 15 0
227980845 Siddharth71 A Oct. 13, 2023, 5:42 a.m. OK GNU C++17 TESTS 4 15 0
227973901 Zhaoby A Oct. 13, 2023, 4:10 a.m. OK GNU C++17 TESTS 4 15 0
227981140 Kazi_Naiyem A Oct. 13, 2023, 5:45 a.m. OK GNU C++17 (64) TESTS 4 15 0
227981775 susuovo A Oct. 13, 2023, 5:52 a.m. OK GNU C++17 (64) TESTS 4 15 0
227974604 Cosysl A Oct. 13, 2023, 4:21 a.m. OK GNU C++17 (64) TESTS 4 15 0
227971405 fs20091003 A Oct. 13, 2023, 3:34 a.m. OK GNU C++17 (64) TESTS 4 15 0
227970654 FLOWPOWER A Oct. 13, 2023, 3:22 a.m. OK GNU C++17 (64) TESTS 4 15 0
227963197 shiro53 A Oct. 13, 2023, 1:08 a.m. OK GNU C++17 (64) TESTS 4 15 0
227948073 juancarlostapiab.1 A Oct. 12, 2023, 7:53 p.m. OK GNU C++17 (64) TESTS 4 15 0
227932372 Askiatic A Oct. 12, 2023, 5:27 p.m. OK GNU C++17 (64) TESTS 4 15 0
227929506 erdoog A Oct. 12, 2023, 5:10 p.m. OK GNU C++17 (64) TESTS 4 15 0
227966298 Anish_Singh_Dhami_07 A Oct. 13, 2023, 2:10 a.m. OK GNU C++17 (64) TESTS 4 15 307200
227932992 CF_contest_practice_2 A Oct. 12, 2023, 5:31 p.m. OK GNU C++20 (64) TESTS 4 0 0
227947768 mahir1 A Oct. 12, 2023, 7:49 p.m. OK GNU C++20 (64) TESTS 4 0 0
227965769 shstyle A Oct. 13, 2023, 2 a.m. OK GNU C++20 (64) TESTS 4 0 107724800
227981390 Light_Cone A Oct. 13, 2023, 5:48 a.m. OK GNU C++20 (64) TESTS 4 15 0
227981801 DYSLEVIUM A Oct. 13, 2023, 5:52 a.m. OK GNU C++20 (64) TESTS 4 15 0
227982031 nelch A Oct. 13, 2023, 5:55 a.m. OK GNU C++20 (64) TESTS 4 15 0
227980113 dask_58 A Oct. 13, 2023, 5:34 a.m. OK GNU C++20 (64) TESTS 4 15 0
227980699 deep_err0r A Oct. 13, 2023, 5:40 a.m. OK GNU C++20 (64) TESTS 4 15 0
227980778 dask_58 A Oct. 13, 2023, 5:41 a.m. OK GNU C++20 (64) TESTS 4 15 0
227981019 Iron_man47 A Oct. 13, 2023, 5:44 a.m. OK GNU C++20 (64) TESTS 4 15 0
227975217 Pirate_coder82 A Oct. 13, 2023, 4:31 a.m. OK Java 11 TESTS 4 202 0
227966533 Panther369 A Oct. 13, 2023, 2:15 a.m. OK Java 11 TESTS 4 202 0
227966222 Panther369 A Oct. 13, 2023, 2:09 a.m. OK Java 11 TESTS 4 202 0
227953057 DOOMJUICE A Oct. 12, 2023, 9:01 p.m. OK Java 11 TESTS 4 202 0
227930871 MaroMaxor A Oct. 12, 2023, 5:18 p.m. OK Java 11 TESTS 4 202 0
227950575 themadknight45 A Oct. 12, 2023, 8:25 p.m. OK Java 11 TESTS 4 233 0
227929542 JorD A Oct. 12, 2023, 5:11 p.m. OK Java 11 TESTS 4 233 0
227937793 Remony A Oct. 12, 2023, 6:10 p.m. OK Java 11 TESTS 4 248 0
227937085 RahulAhuja2901 A Oct. 12, 2023, 6:04 p.m. OK Java 11 TESTS 4 265 102400
227931221 hitesh21392 A Oct. 12, 2023, 5:20 p.m. OK Java 11 TESTS 4 296 0
227934680 maurya.rahul682 A Oct. 12, 2023, 5:44 p.m. OK Java 17 TESTS 4 217 102400
227967119 Prime369 A Oct. 13, 2023, 2:25 a.m. OK Java 17 TESTS 4 218 409600
227924082 greyrk A Oct. 12, 2023, 4:49 p.m. OK Java 17 TESTS 4 233 0
227972808 aFShahahahxx A Oct. 13, 2023, 3:55 a.m. OK Java 17 TESTS 4 233 409600
227944488 vikash_45 A Oct. 12, 2023, 7:12 p.m. OK Java 17 TESTS 4 248 716800
227944310 vikash_45 A Oct. 12, 2023, 7:11 p.m. OK Java 17 TESTS 4 249 614400
227944000 aishwarykesarwani A Oct. 12, 2023, 7:07 p.m. OK Java 17 TESTS 4 249 5836800
227935043 1isGreaterThan0 A Oct. 12, 2023, 5:47 p.m. OK Java 17 TESTS 4 265 0
227933570 aman_0802 A Oct. 12, 2023, 5:36 p.m. OK Java 17 TESTS 4 265 512000
227933623 vikasseervi357 A Oct. 12, 2023, 5:36 p.m. OK Java 17 TESTS 4 280 102400
227953471 rpdhakar2003 A Oct. 12, 2023, 9:09 p.m. OK Java 21 TESTS 4 202 0
227953926 harshmishra05672 A Oct. 12, 2023, 9:17 p.m. OK Java 21 TESTS 4 327 0
227931830 Marcelace A Oct. 12, 2023, 5:24 p.m. OK Java 21 TESTS 4 327 0
227923919 Just_Average A Oct. 12, 2023, 4:49 p.m. OK Java 21 TESTS 4 342 0
227939729 123ayush_shukla A Oct. 12, 2023, 6:27 p.m. OK Java 21 TESTS 4 358 0
227927431 sumair007 A Oct. 12, 2023, 5:01 p.m. OK Java 21 TESTS 4 358 0
227977199 Parteek720 A Oct. 13, 2023, 4:58 a.m. OK Java 21 TESTS 4 374 0
227964260 goalboy A Oct. 13, 2023, 1:30 a.m. OK Java 21 TESTS 4 404 0
227974975 _AKR_ A Oct. 13, 2023, 4:27 a.m. OK Java 21 TESTS 4 873 0
227924080 PassedPawn A Oct. 12, 2023, 4:49 p.m. OK Java 8 TESTS 4 93 0
227957852 IOFYA A Oct. 12, 2023, 10:45 p.m. OK Java 8 TESTS 4 109 0
227940202 Abood19 A Oct. 12, 2023, 6:30 p.m. OK Java 8 TESTS 4 124 0
227941637 lulanovvvl A Oct. 12, 2023, 6:44 p.m. OK Java 8 TESTS 4 124 38195200
227959830 mohamedhassan_c A Oct. 12, 2023, 11:41 p.m. OK Java 8 TESTS 4 155 5836800
227945711 sumitlaura101 A Oct. 12, 2023, 7:25 p.m. OK Java 8 TESTS 4 187 5939200
227940207 Sumitsingh7 A Oct. 12, 2023, 6:30 p.m. OK Java 8 TESTS 4 187 5939200
227970088 coderman2004 A Oct. 13, 2023, 3:14 a.m. OK Java 8 TESTS 4 233 0
227954616 Toosid A Oct. 12, 2023, 9:30 p.m. OK Java 8 TESTS 4 248 0
227932629 Dewansh_yadav A Oct. 12, 2023, 5:29 p.m. OK Java 8 TESTS 4 264 0
227928776 Krantzy A Oct. 12, 2023, 5:07 p.m. OK Kotlin 1.7 TESTS 4 514 18329600
227926489 Golovanov399 A Oct. 12, 2023, 4:57 p.m. OK Kotlin 1.7 TESTS 4 529 10137600
227955028 AvanSingh A Oct. 12, 2023, 9:38 p.m. OK MS C++ 2017 TESTS 4 46 0
227947455 Olzlzlz A Oct. 12, 2023, 7:45 p.m. OK MS C++ 2017 TESTS 4 62 0
227964406 jisiliao A Oct. 13, 2023, 1:33 a.m. OK MS C++ 2017 TESTS 4 77 0
227973380 SirCactuz A Oct. 13, 2023, 4:03 a.m. OK MS C++ 2017 TESTS 4 78 0
227979157 Hllccmm A Oct. 13, 2023, 5:23 a.m. OK MS C++ 2017 TESTS 4 93 0
227965626 siowyeeceng3 A Oct. 13, 2023, 1:57 a.m. OK MS C++ 2017 TESTS 4 124 102400
227939133 sadaev A Oct. 12, 2023, 6:21 p.m. OK PHP TESTS 4 77 0
227968915 YMSeah A Oct. 13, 2023, 2:54 a.m. OK PyPy 3 TESTS 4 140 5222400
227943532 Joshc A Oct. 12, 2023, 7:03 p.m. OK PyPy 3 TESTS 4 155 7475200
227952360 ebesso A Oct. 12, 2023, 8:51 p.m. OK PyPy 3 TESTS 4 187 73932800
227978865 kalesaur A Oct. 13, 2023, 5:20 a.m. OK PyPy 3 TESTS 4 405 7475200
227958079 apoxy A Oct. 12, 2023, 10:51 p.m. OK PyPy 3 TESTS 4 452 9625600
227926715 Khatarnak_Khandu A Oct. 12, 2023, 4:58 p.m. OK PyPy 3 TESTS 4 452 9830400
227943538 emrakul A Oct. 12, 2023, 7:03 p.m. OK PyPy 3 TESTS 4 467 9216000
227926539 armfield A Oct. 12, 2023, 4:57 p.m. OK PyPy 3 TESTS 4 467 9216000
227967881 whoami096 A Oct. 13, 2023, 2:38 a.m. OK PyPy 3 TESTS 4 467 9625600
227955814 EruEru A Oct. 12, 2023, 9:56 p.m. OK PyPy 3 TESTS 4 467 9625600
227958753 riroan A Oct. 12, 2023, 11:10 p.m. OK PyPy 3-64 TESTS 4 109 9728000
227943438 harrylfoppa A Oct. 12, 2023, 7:02 p.m. OK PyPy 3-64 TESTS 4 124 9011200
227975864 terrablader11 A Oct. 13, 2023, 4:40 a.m. OK PyPy 3-64 TESTS 4 139 9318400
227943940 gardengnome A Oct. 12, 2023, 7:07 p.m. OK PyPy 3-64 TESTS 4 139 9728000
227938481 siiuuuu A Oct. 12, 2023, 6:16 p.m. OK PyPy 3-64 TESTS 4 139 10342400
227965184 noahy A Oct. 13, 2023, 1:48 a.m. OK PyPy 3-64 TESTS 4 140 9318400
227927713 npl_27 A Oct. 12, 2023, 5:02 p.m. OK PyPy 3-64 TESTS 4 140 9523200
227944504 cybsbbb A Oct. 12, 2023, 7:13 p.m. OK PyPy 3-64 TESTS 4 155 9932800
227928086 khalit7 A Oct. 12, 2023, 5:04 p.m. OK PyPy 3-64 TESTS 4 155 9932800
227930179 Azamatsh A Oct. 12, 2023, 5:14 p.m. OK PyPy 3-64 TESTS 4 155 10137600
227968296 packkill A Oct. 13, 2023, 2:44 a.m. OK Python 3 TESTS 4 77 1638400
227947694 abhi.ch891 A Oct. 12, 2023, 7:48 p.m. OK Python 3 TESTS 4 93 1433600
227968407 packkill A Oct. 13, 2023, 2:46 a.m. OK Python 3 TESTS 4 93 1536000
227976025 biswasbikram A Oct. 13, 2023, 4:42 a.m. OK Python 3 TESTS 4 108 0
227952984 LuisTinoco A Oct. 12, 2023, 9 p.m. OK Python 3 TESTS 4 108 0
227946451 OmarBouat A Oct. 12, 2023, 7:33 p.m. OK Python 3 TESTS 4 108 0
227931561 mridulchill A Oct. 12, 2023, 5:22 p.m. OK Python 3 TESTS 4 108 0
227929301 studypab A Oct. 12, 2023, 5:09 p.m. OK Python 3 TESTS 4 108 0
227965442 ct17 A Oct. 13, 2023, 1:53 a.m. OK Python 3 TESTS 4 108 102400
227929764 az_1zbek A Oct. 12, 2023, 5:12 p.m. OK Python 3 TESTS 4 108 102400
227934590 chromate00 A Oct. 12, 2023, 5:44 p.m. OK Ruby 3 TESTS 4 420 409600
227954651 SymphonySimper A Oct. 12, 2023, 9:31 p.m. OK Rust 2021 TESTS 4 93 0
227940484 _a253 A Oct. 12, 2023, 6:33 p.m. OK Rust 2021 TESTS 4 109 0
227939155 Mblrloc A Oct. 12, 2023, 6:21 p.m. OK Rust 2021 TESTS 4 139 0

remove filters

Back to search problems