Codeforces Round 1017 (Div. 4)

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
2094 Codeforces Round 1017 (Div. 4) FINISHED False 8100 31847123 April 13, 2025, 3:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 23743 ) D Tung Tung Sahur PROGRAMMING greedy strings two pointers

You have two drums in front of you: a left drum and a right drum. A hit on the left can be recorded as " L ", and a hit on the right as " R ". The strange forces that rule this world are fickle: sometimes, a blow sounds once, and sometimes it sounds twice. Therefore, a hit on the left drum could have sounded as either " L " or " LL ", and a hit on the right drum could have sounded as either " R " or " RR ". The sequence of hits made is recorded in the string (p), and the sounds heard are in the string (s). Given (p) and (s), determine whether it is true that the string (s) could have been the result of the hits from the string (p). For example, if (p=)" LR ", then the result of the hits could be any of the strings " LR ", " LRR ", " LLR ", and " LLRR ", but the strings " LLLR " or " LRL " cannot. The first line contains an integer (t) ((1 \leq t \leq 10^4)) – the number of independent test cases. The first line of each test case contains the string (p) ((1 \le |p| \le 2 \cdot 10^5)) consisting only of the characters " R " and " L ", where (|p|) denotes the length of the string (p). The second line of each test case contains the string (s) ((1 \le |p| \le |s| \le 2 \cdot 10^5)) consisting only of the characters " R " and " L ". It is guaranteed that the sum of (|s|) does not exceed (2\cdot 10^5) across all test cases. For each set of input data, output " YES " if (s) can be the heard sound, and " NO " otherwise. You may output in any case.

Tutorials

Codeforces Round 1017 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
315538620 VarunGolcha D April 14, 2025, 6:06 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315538077 CAELO D April 14, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315536218 divy_ansh D April 14, 2025, 5:43 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315536141 adeu-21 D April 14, 2025, 5:42 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315536081 Natsume__Ai D April 14, 2025, 5:41 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315535757 thomas_5791 D April 14, 2025, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315535743 SangNi D April 14, 2025, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315535735 naveen_8801 D April 14, 2025, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315534406 sameerbamanha D April 14, 2025, 5:25 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315533580 ep24btech11021 D April 14, 2025, 5:17 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
315516759 ddxiangshang D April 14, 2025, 12:38 a.m. OK C++20 (GCC 13-64) TESTS 6 31 0
315488025 rahatraihan D April 13, 2025, 6:12 p.m. OK C++20 (GCC 13-64) TESTS 6 31 0
315486015 SidM007 D April 13, 2025, 6:01 p.m. OK C++20 (GCC 13-64) TESTS 6 31 0
315538039 trizz_24 D April 14, 2025, 6:01 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315537733 jianjianj D April 14, 2025, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315536577 nghilam D April 14, 2025, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315536517 schmOple D April 14, 2025, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315536066 shiyemoxia D April 14, 2025, 5:41 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315535832 Dewan_Abir_Mahmud D April 14, 2025, 5:39 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315535125 l0ne_walker D April 14, 2025, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 6 46 0
315537127 Tahir98 D April 14, 2025, 5:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 30 0
315537045 link1k D April 14, 2025, 5:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315531231 Asdezx D April 14, 2025, 4:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315530644 Coder.124421 D April 14, 2025, 4:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315526136 Souture D April 14, 2025, 3:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315522640 AboRehab11 D April 14, 2025, 2:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315500308 seif_karoui D April 13, 2025, 7:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315486568 _Divine_ D April 13, 2025, 6:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
315521473 soulbloom D April 14, 2025, 2:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 102400
315514645 ha203811 D April 13, 2025, 11:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 409600
315486418 tea_123__ D April 13, 2025, 6:03 p.m. OK GNU C11 TESTS 6 93 409600
315493194 Divine_Anii D April 13, 2025, 6:46 p.m. OK Java 21 TESTS 6 203 409600
315507303 akshat.codes D April 13, 2025, 9:06 p.m. OK Java 21 TESTS 6 233 819200
315512794 sarthaKKharKa_18 D April 13, 2025, 10:41 p.m. OK Java 21 TESTS 6 233 921600
315495478 axv D April 13, 2025, 7:04 p.m. OK Java 21 TESTS 6 234 0
315493252 axv D April 13, 2025, 6:47 p.m. OK Java 21 TESTS 6 234 409600
315493120 shumba D April 13, 2025, 6:46 p.m. OK Java 21 TESTS 6 234 409600
315515083 shaham D April 13, 2025, 11:49 p.m. OK Java 21 TESTS 6 234 921600
315511178 gupta_harshal D April 13, 2025, 10:07 p.m. OK Java 21 TESTS 6 249 614400
315507155 Taha_001 D April 13, 2025, 9:04 p.m. OK Java 21 TESTS 6 249 716800
315501688 fatal-98 D April 13, 2025, 8 p.m. OK Java 21 TESTS 6 249 716800
315519224 Harshu_001 D April 14, 2025, 1:43 a.m. OK Java 8 TESTS 6 124 0
315494272 Pranav_45 D April 13, 2025, 6:55 p.m. OK Java 8 TESTS 6 140 0
315537179 ChongQY D April 14, 2025, 5:52 a.m. OK Java 8 TESTS 6 156 39731200
315503247 Shashwata_32 D April 13, 2025, 8:16 p.m. OK Java 8 TESTS 6 186 0
315535317 kaustubh_verma D April 14, 2025, 5:34 a.m. OK Java 8 TESTS 6 202 0
315498510 smg_raza D April 13, 2025, 7:29 p.m. OK Java 8 TESTS 6 202 0
315498357 Max99 D April 13, 2025, 7:28 p.m. OK Java 8 TESTS 6 217 0
315523949 Dduo D April 14, 2025, 3:17 a.m. OK Java 8 TESTS 6 281 0
315505889 kingcabrams D April 13, 2025, 8:47 p.m. OK Kotlin 1.9 TESTS 6 171 0
315527368 zoro741 D April 14, 2025, 4:07 a.m. OK Kotlin 1.9 TESTS 6 187 0
315519033 Eevee8845 D April 14, 2025, 1:38 a.m. OK Node.js TESTS 6 187 11059200
315490528 YhuanDebeste D April 13, 2025, 6:27 p.m. OK Perl TESTS 6 405 53657600
315489454 YhuanDebeste D April 13, 2025, 6:21 p.m. OK Perl TESTS 6 421 42393600
315489852 YhuanDebeste D April 13, 2025, 6:23 p.m. OK Perl TESTS 6 421 53760000
315489790 YhuanDebeste D April 13, 2025, 6:23 p.m. OK Perl TESTS 6 452 53657600
315488517 YhuanDebeste D April 13, 2025, 6:15 p.m. OK Perl TESTS 6 530 42598400
315520303 Freed_man D April 14, 2025, 2:08 a.m. OK PyPy 3 TESTS 6 171 17408000
315516527 coder.sy D April 14, 2025, 12:32 a.m. OK PyPy 3 TESTS 6 265 8601600
315491486 arina_romashkina D April 13, 2025, 6:34 p.m. OK PyPy 3 TESTS 6 296 9318400
315506757 gift_of_Allah D April 13, 2025, 8:58 p.m. OK PyPy 3 TESTS 6 296 28672000
315506440 BLACKDEX09 D April 13, 2025, 8:54 p.m. OK PyPy 3 TESTS 6 296 28672000
315486378 Mr.Beast192 D April 13, 2025, 6:03 p.m. OK PyPy 3 TESTS 6 358 16896000
315501391 Srivissy D April 13, 2025, 7:57 p.m. OK PyPy 3 TESTS 6 374 10956800
315501301 smilence D April 13, 2025, 7:56 p.m. OK PyPy 3-64 TESTS 6 108 4198400
315508572 VIGGY D April 13, 2025, 9:23 p.m. OK PyPy 3-64 TESTS 6 124 3686400
315508179 Vignesh_Pandi D April 13, 2025, 9:17 p.m. OK PyPy 3-64 TESTS 6 124 3686400
315490770 gardengnome D April 13, 2025, 6:29 p.m. OK PyPy 3-64 TESTS 6 124 3891200
315508715 Vignesh_Pandi D April 13, 2025, 9:25 p.m. OK PyPy 3-64 TESTS 6 124 5120000
315487639 parpan D April 13, 2025, 6:10 p.m. OK PyPy 3-64 TESTS 6 124 5324800
315499335 sangx D April 13, 2025, 7:37 p.m. OK PyPy 3-64 TESTS 6 124 5427200
315507307 KiRa_X D April 13, 2025, 9:06 p.m. OK PyPy 3-64 TESTS 6 124 5939200
315514474 juicelord D April 13, 2025, 11:29 p.m. OK PyPy 3-64 TESTS 6 124 8908800
315533308 BLZ_LaiCai D April 14, 2025, 5:14 a.m. OK PyPy 3-64 TESTS 6 124 16384000
315507010 Phantom_702 D April 13, 2025, 9:02 p.m. OK Python 3 TESTS 6 93 3584000
315514300 makebANK D April 13, 2025, 11:23 p.m. OK Python 3 TESTS 6 109 1331200
315496672 Anky1323 D April 13, 2025, 7:14 p.m. OK Python 3 TESTS 6 124 3788800
315495717 napster0207 D April 13, 2025, 7:06 p.m. OK Python 3 TESTS 6 124 6041600
315532215 file1997 D April 14, 2025, 5:03 a.m. OK Python 3 TESTS 6 125 1228800
315534067 princebaladitya D April 14, 2025, 5:22 a.m. OK Python 3 TESTS 6 140 3584000
315534990 D_Malhar04 D April 14, 2025, 5:31 a.m. OK Python 3 TESTS 6 156 3584000
315533579 princebaladitya D April 14, 2025, 5:17 a.m. OK Python 3 TESTS 6 156 6246400
315533479 astrosdg D April 14, 2025, 5:16 a.m. OK Python 3 TESTS 6 171 8806400
315537262 arnavsaini2135 D April 14, 2025, 5:53 a.m. OK Python 3 TESTS 6 186 8806400
315536328 letting_go D April 14, 2025, 5:44 a.m. OK Rust 2021 TESTS 6 46 102400

remove filters

Back to search problems