Codeforces Round 1043 (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
2132 Codeforces Round 1043 (Div. 3) FINISHED False 8100 20618723 Aug. 21, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 43105 ) A Homework PROGRAMMING brute force implementation strings

Vlad and Dima have been assigned a task in school for their English class. They were given two strings (a) and (b) and asked to append all characters from (b) to string (a) in any order. The guys decided to divide the work between themselves and, after lengthy negotiations, determined who would add each character from string (b) to (a). Due to his peculiarities, Vlad can only add characters to the beginning of the word, while Dima can only add them to the end. They add characters in the order they appear in string (b). Your task is to determine what string Vlad and Dima will end up with. Each test consists of several test cases. The first line contains a single integer (t) ((1 \le t \le 1000)) — the number of test cases. The description of the test cases follows. The first line contains an integer (n) ((1 \le n \le 10)) — the length of the string (a). The second line contains the string (a), consisting of lowercase letters of the English alphabet. The third line contains an integer (m) ((1 \le m \le 10)) — the length of the strings (b) and (c). The fourth line contains the string (b), consisting of lowercase letters of the English alphabet. The fifth line contains the string (c), consisting of the characters 'V' and 'D' — the distribution of the characters of string (b) between Dima and Vlad. If (c_i) = 'V' , then the (i)-th letter is added by Vlad; otherwise, it is added by Dima. For each test case, output the string that will result from Dima and Vlad's work. In the first test case, there is initially a string (ot). Then Dima appends the character (a) to the end of the string, resulting in (ota), and Vlad appends the last character, resulting in (dota). In the second test case, the string will change as follows: $$$efo \rightarrow efor \rightarrow defor \rightarrow deforc \rightarrow odeforc \rightarrow odeforce \rightarrow codeforce \rightarrow codefo

Tutorials

Codeforces Round 1043 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
335067440 PortalGreed A Aug. 22, 2025, 5:02 p.m. OK C# 10 TESTS 2 124 102400
335116747 og.kostya A Aug. 23, 2025, 6:08 a.m. OK C# 13 TESTS 2 77 0
335082005 SF7 A Aug. 22, 2025, 7:20 p.m. OK C# 13 TESTS 2 77 3072000
335256998 qqnk67 A Aug. 24, 2025, 5:53 a.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335187846 tha7a A Aug. 23, 2025, 3:29 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335161956 aryan_avs_ A Aug. 23, 2025, 12:07 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335130089 Bluefire_4 A Aug. 23, 2025, 8:06 a.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335097771 MorilloK A Aug. 23, 2025, 12:53 a.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335094607 IgorPrado A Aug. 22, 2025, 11:07 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335077791 skull-code2.0 A Aug. 22, 2025, 6:31 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335062362 zbdn573 A Aug. 22, 2025, 4:19 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335061720 Curious_Alien A Aug. 22, 2025, 4:14 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335046896 litch012 A Aug. 22, 2025, 2:21 p.m. OK C++17 (GCC 7-32) TESTS 2 15 0
335210964 JohanLibert0 A Aug. 23, 2025, 6:35 p.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335165401 vaibhavtyagi9981 A Aug. 23, 2025, 12:33 p.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335148444 BeGukesh A Aug. 23, 2025, 10:21 a.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335126177 tharun A Aug. 23, 2025, 7:35 a.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335054601 Mariom A Aug. 22, 2025, 3:19 p.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335050321 ezavs A Aug. 22, 2025, 2:46 p.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335035625 desparado A Aug. 22, 2025, 1 p.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335035272 Amadeus027 A Aug. 22, 2025, 12:57 p.m. OK C++20 (GCC 13-64) TESTS 2 15 0
335251228 ravig31 A Aug. 24, 2025, 5:11 a.m. OK C++20 (GCC 13-64) TESTS 2 30 0
335249971 ERROR429 A Aug. 24, 2025, 4:52 a.m. OK C++20 (GCC 13-64) TESTS 2 30 0
335231652 TLE_Automat_Fan A Aug. 24, 2025, 1:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335228644 amr57khaled A Aug. 23, 2025, 11:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335197417 Qpxwyzdfsbfsphiepsilon A Aug. 23, 2025, 4:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335190452 ultimateLoser A Aug. 23, 2025, 3:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335182104 Daniyal A Aug. 23, 2025, 2:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335099596 bhaskar_sahil A Aug. 23, 2025, 1:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335071914 anonymous_2025 A Aug. 22, 2025, 5:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335042234 Iitprep3 A Aug. 22, 2025, 1:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335040556 amber69 A Aug. 22, 2025, 1:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335039912 Terminal_P A Aug. 22, 2025, 1:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 15 0
335250635 MOHOSIN33 A Aug. 24, 2025, 5:02 a.m. OK GNU C11 TESTS 2 15 0
335054443 david_codeforce A Aug. 22, 2025, 3:18 p.m. OK GNU C11 TESTS 2 15 0
335043242 hhxx A Aug. 22, 2025, 1:54 p.m. OK GNU C11 TESTS 2 15 0
335021527 tilakasodariya A Aug. 22, 2025, 10:54 a.m. OK GNU C11 TESTS 2 15 0
335213603 ICPCCode A Aug. 23, 2025, 7:01 p.m. OK GNU C11 TESTS 2 30 0
335196813 Poorni56 A Aug. 23, 2025, 4:46 p.m. OK GNU C11 TESTS 2 30 0
335054268 david_codeforce A Aug. 22, 2025, 3:16 p.m. OK GNU C11 TESTS 2 30 0
335179468 lemoyn21 A Aug. 23, 2025, 2:20 p.m. OK GNU C11 TESTS 2 31 0
335177496 bewada A Aug. 23, 2025, 2:04 p.m. OK GNU C11 TESTS 2 31 0
335053937 david_codeforce A Aug. 22, 2025, 3:14 p.m. OK GNU C11 TESTS 2 31 0
335019507 shisukenohara A Aug. 22, 2025, 10:35 a.m. OK Go TESTS 2 46 102400
335103855 tahsin_ferdous A Aug. 23, 2025, 3:19 a.m. OK Go TESTS 2 46 204800
335179000 Yo-Pta A Aug. 23, 2025, 2:16 p.m. OK Go TESTS 2 46 307200
335078907 zap4eg A Aug. 22, 2025, 6:44 p.m. OK Go TESTS 2 61 307200
335075641 sky_coder_ A Aug. 22, 2025, 6:12 p.m. OK Go TESTS 2 62 102400
335020163 shisukenohara A Aug. 22, 2025, 10:41 a.m. OK Go TESTS 2 62 204800
335019772 shisukenohara A Aug. 22, 2025, 10:37 a.m. OK Go TESTS 2 62 307200
335078803 sky_coder_ A Aug. 22, 2025, 6:43 p.m. OK Go TESTS 2 77 204800
335019315 shisukenohara A Aug. 22, 2025, 10:32 a.m. OK Go TESTS 2 77 9318400
335047764 Ujjwal_108 A Aug. 22, 2025, 2:27 p.m. OK Java 21 TESTS 2 186 0
335131694 raunak_shah666 A Aug. 23, 2025, 8:19 a.m. OK Java 21 TESTS 2 186 716800
335020469 Dinesh_k40 A Aug. 22, 2025, 10:44 a.m. OK Java 21 TESTS 2 186 1228800
335199787 hamossa A Aug. 23, 2025, 5:10 p.m. OK Java 21 TESTS 2 187 102400
335075941 mikemajlak A Aug. 22, 2025, 6:14 p.m. OK Java 21 TESTS 2 187 716800
335090526 CrinklyGolem A Aug. 22, 2025, 9:22 p.m. OK Java 21 TESTS 2 202 0
335240525 sudharshana.d2022ece A Aug. 24, 2025, 4:13 a.m. OK Java 21 TESTS 2 202 614400
335200397 jatin2708 A Aug. 23, 2025, 5:14 p.m. OK Java 21 TESTS 2 202 614400
335039286 inseder A Aug. 22, 2025, 1:27 p.m. OK Java 21 TESTS 2 203 0
335028155 John231 A Aug. 22, 2025, 11:57 a.m. OK Java 21 TESTS 2 217 1126400
335060869 sauravmandal A Aug. 22, 2025, 4:07 p.m. OK Java 8 TESTS 2 109 0
335034391 Mostafa_Murad A Aug. 22, 2025, 12:50 p.m. OK Java 8 TESTS 2 124 0
335079601 vineet175 A Aug. 22, 2025, 6:52 p.m. OK Java 8 TESTS 2 139 0
335031769 sksinghal17 A Aug. 22, 2025, 12:27 p.m. OK Java 8 TESTS 2 139 0
335220722 harshwardhanraj2004 A Aug. 23, 2025, 8:29 p.m. OK Java 8 TESTS 2 155 0
335178267 TonyJr2056 A Aug. 23, 2025, 2:10 p.m. OK Java 8 TESTS 2 155 0
335063580 anikateagrawal A Aug. 22, 2025, 4:29 p.m. OK Java 8 TESTS 2 155 0
335053999 tatinenimohith A Aug. 22, 2025, 3:14 p.m. OK Java 8 TESTS 2 155 0
335052400 Pranitha_2004 A Aug. 22, 2025, 3:01 p.m. OK Java 8 TESTS 2 155 0
335018323 sorter A Aug. 22, 2025, 10:22 a.m. OK Java 8 TESTS 2 155 0
335219885 swseverance A Aug. 23, 2025, 8:16 p.m. OK Node.js TESTS 2 77 3481600
335055403 karimmalidev A Aug. 22, 2025, 3:25 p.m. OK Node.js TESTS 2 93 2150400
335077545 kac3pro A Aug. 22, 2025, 6:29 p.m. OK OCaml TESTS 2 30 0
335170105 veeramallaakshith0 A Aug. 23, 2025, 1:10 p.m. OK PyPy 3 TESTS 2 93 2457600
335135807 prselvak A Aug. 23, 2025, 8:48 a.m. OK PyPy 3 TESTS 2 124 3379200
335046525 Prathmesh_H A Aug. 22, 2025, 2:18 p.m. OK PyPy 3 TESTS 2 140 4096000
335105353 adriandabeast A Aug. 23, 2025, 3:40 a.m. OK PyPy 3 TESTS 2 171 5836800
335091737 Tip_Monster A Aug. 22, 2025, 9:50 p.m. OK PyPy 3 TESTS 2 187 5836800
335048252 haseeb_adnaan A Aug. 22, 2025, 2:31 p.m. OK PyPy 3 TESTS 2 187 5836800
335061215 miroslav13 A Aug. 22, 2025, 4:10 p.m. OK PyPy 3 TESTS 2 202 5632000
335158598 ravi_krst A Aug. 23, 2025, 11:40 a.m. OK PyPy 3 TESTS 2 202 5734400
335113129 jainkrishna A Aug. 23, 2025, 5:30 a.m. OK PyPy 3 TESTS 2 233 6246400
335162638 sathvik_666 A Aug. 23, 2025, 12:13 p.m. OK PyPy 3 TESTS 2 249 7680000
335145155 mayank94 A Aug. 23, 2025, 9:57 a.m. OK PyPy 3-64 TESTS 2 77 2048000
335064747 gauravkumar74123 A Aug. 22, 2025, 4:38 p.m. OK PyPy 3-64 TESTS 2 77 4198400
335228399 tongpengdl A Aug. 23, 2025, 11:33 p.m. OK PyPy 3-64 TESTS 2 93 2867200
335116732 yoichii A Aug. 23, 2025, 6:08 a.m. OK PyPy 3-64 TESTS 2 93 4198400
335182486 MinValgen A Aug. 23, 2025, 2:44 p.m. OK PyPy 3-64 TESTS 2 108 2150400
335165859 iamUB2002 A Aug. 23, 2025, 12:37 p.m. OK PyPy 3-64 TESTS 2 108 2252800
335140091 Haksell A Aug. 23, 2025, 9:20 a.m. OK PyPy 3-64 TESTS 2 108 2764800
335077519 preritadvani A Aug. 22, 2025, 6:29 p.m. OK PyPy 3-64 TESTS 2 108 3686400
335228297 tanayb18 A Aug. 23, 2025, 11:28 p.m. OK PyPy 3-64 TESTS 2 108 4198400
335118487 Arisbek A Aug. 23, 2025, 6:26 a.m. OK PyPy 3-64 TESTS 2 108 4300800
335206119 Sanjos A Aug. 23, 2025, 5:57 p.m. OK Python 2 TESTS 2 46 0
335247115 Awsoemio A Aug. 24, 2025, 4:40 a.m. OK Python 3 TESTS 2 46 0
335233895 xJFGRx A Aug. 24, 2025, 2:47 a.m. OK Python 3 TESTS 2 46 0
335225807 shivangkeshri3 A Aug. 23, 2025, 10:05 p.m. OK Python 3 TESTS 2 46 0
335225678 shivangkeshri3 A Aug. 23, 2025, 10:01 p.m. OK Python 3 TESTS 2 46 0
335222824 n00b07 A Aug. 23, 2025, 9:02 p.m. OK Python 3 TESTS 2 46 0
335220873 avengers2405 A Aug. 23, 2025, 8:31 p.m. OK Python 3 TESTS 2 46 0
335110574 Shiro_O A Aug. 23, 2025, 4:58 a.m. OK Python 3 TESTS 2 46 0
335107594 1nn0C3nt A Aug. 23, 2025, 4:16 a.m. OK Python 3 TESTS 2 46 0
335083293 sunny0405 A Aug. 22, 2025, 7:36 p.m. OK Python 3 TESTS 2 46 0
335069238 zawad10 A Aug. 22, 2025, 5:17 p.m. OK Python 3 TESTS 2 46 0
335191644 Ckiddo A Aug. 23, 2025, 4:02 p.m. OK Rust 2021 TESTS 2 31 0
335039173 notarmen A Aug. 22, 2025, 1:26 p.m. OK Rust 2021 TESTS 2 31 0
335205571 dchakarwarti A Aug. 23, 2025, 5:53 p.m. OK Rust 2021 TESTS 2 46 0
335227201 kartikey_20cs A Aug. 23, 2025, 10:47 p.m. OK Rust 2024 TESTS 2 31 0
335205656 dchakarwarti A Aug. 23, 2025, 5:54 p.m. OK Rust 2024 TESTS 2 46 0

remove filters

Back to search problems