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 |
---|---|---|---|---|---|---|
1986 | Codeforces Round 954 (Div. 3) | FINISHED | False | 8100 | 18025763 | June 23, 2024, 2:50 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 23384 ) | C | Update Queries | PROGRAMMING | data structures greedy sortings |
B"Let's consider the following simple problem. You are given a string s of length n , consisting of lowercase Latin letters, as well as an array of indices ind of length m ( 1 <= q ind_i <= q n ) and a string c of length m , consisting of lowercase Latin letters. Then, in order, you perform the update operations, namely, during the i -th operation, you set s_{ind_i} = c_i . Note that you perform all m operations from the first to the last. Of course, if you change the order of indices in the array ind and/or the order of letters in the string c , you can get different results. Find the lexicographically smallest string s that can be obtained after m update operations, if you can rearrange the indices in the array ind and the letters in the string c as you like. A string a is lexicographically less than a string b if and only if one of the following conditions is met: Each test consists of several sets of input data. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of sets of input data. Then follows their description. The first line of each set of input data contains two integers n and m ( 1 <= q n, m <= q 10^5 ) -- the length of the string s and the number of updates. The second line of each set of input data contains a string s of length n , consisting of lowercase Latin letters. The third line of each set of input data contains m integers ind_1, ind_2, ldots, ind_m ( 1 <= q ind_i <= q n ) -- the array of indices ind . The fourth line of each set of input data contains a string c of length m , consisting of lowercase Latin letters. It is guaranteed that the sum of n over all sets of input data does not exceed 2 cdot 10^5 . Similarly, the sum of m over all sets of input data does not exceed 2 cdot 10^5 . For each set of inp"... |
130762 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
267087184 | Lismar | C | June 23, 2024, 6:06 p.m. | OK | C# 10 | TESTS | 8 | 155 | 13721600 | ||
267076824 | abobaghoul | C | June 23, 2024, 5:03 p.m. | OK | C# 10 | TESTS | 8 | 296 | 18739200 | ||
267107181 | 1e-9 | C | June 23, 2024, 10:45 p.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 92 | 0 | ||
267081590 | sam3054 | C | June 23, 2024, 5:23 p.m. | OK | C++14 (GCC 6-32) | TESTS | 8 | 93 | 0 | ||
267127434 | rafelcastrill23d23 | C | June 24, 2024, 4:51 a.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 93 | 0 | ||
267089440 | Garg_Parth | C | June 23, 2024, 6:26 p.m. | OK | C++14 (GCC 6-32) | TESTS | 8 | 93 | 0 | ||
267127446 | hojiakbarumarov9 | C | June 24, 2024, 4:51 a.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 93 | 0 | ||
267107433 | Weekoder | C | June 23, 2024, 10:50 p.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 93 | 819200 | ||
267111248 | Wuyanru | C | June 24, 2024, 12:22 a.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 93 | 1228800 | ||
267109172 | lzh999 | C | June 23, 2024, 11:30 p.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 93 | 9011200 | ||
267095946 | kuro_ryuu | C | June 23, 2024, 7:41 p.m. | OK | C++14 (GCC 6-32) | TESTS | 8 | 108 | 0 | ||
267119392 | 03shree | C | June 24, 2024, 3:06 a.m. | OK | C++14 (GCC 6-32) | TESTS | 14 | 108 | 0 | ||
267087237 | dasr63328 | C | June 23, 2024, 6:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 77 | 0 | ||
267086683 | maksudul | C | June 23, 2024, 6:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 77 | 0 | ||
267123488 | Mahskaslagnis | C | June 24, 2024, 4:03 a.m. | OK | C++17 (GCC 7-32) | TESTS | 14 | 77 | 0 | ||
267086773 | BroWnies_ | C | June 23, 2024, 6:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 77 | 0 | ||
267085139 | 7Bentleys | C | June 23, 2024, 5:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 78 | 0 | ||
267124409 | Dauren_Miras | C | June 24, 2024, 4:14 a.m. | OK | C++17 (GCC 7-32) | TESTS | 14 | 78 | 0 | ||
267118818 | _Adam_ | C | June 24, 2024, 2:56 a.m. | OK | C++17 (GCC 7-32) | TESTS | 14 | 78 | 0 | ||
267098672 | G_Ayan7 | C | June 23, 2024, 8:17 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 78 | 0 | ||
267087695 | AbdRahmanMiassar | C | June 23, 2024, 6:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 78 | 0 | ||
267078746 | ._S_Raj_. | C | June 23, 2024, 5:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 8 | 78 | 0 | ||
267086945 | BroWns. | C | June 23, 2024, 6:04 p.m. | OK | C++20 (GCC 13-64) | TESTS | 8 | 62 | 0 | ||
267086250 | rafiwho | C | June 23, 2024, 5:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 8 | 62 | 0 | ||
267113733 | N_z__ | C | June 24, 2024, 1:20 a.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 62 | 102400 | ||
267119413 | bibhuti.bat | C | June 24, 2024, 3:06 a.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 0 | ||
267117620 | Aicu | C | June 24, 2024, 2:36 a.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 0 | ||
267115805 | chinthamjeevanreddy | C | June 24, 2024, 2:03 a.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 0 | ||
267101241 | Mayar._.refaat | C | June 23, 2024, 8:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 0 | ||
267111110 | schmosby | C | June 24, 2024, 12:18 a.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 0 | ||
267097512 | Aspergillus | C | June 23, 2024, 8:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 8 | 77 | 0 | ||
267124472 | Stormshadow26 | C | June 24, 2024, 4:15 a.m. | OK | C++20 (GCC 13-64) | TESTS | 14 | 77 | 0 | ||
267111985 | bluemegane | C | June 24, 2024, 12:40 a.m. | OK | C# 8 | TESTS | 14 | 124 | 13926400 | ||
267108342 | bluemegane | C | June 23, 2024, 11:11 p.m. | OK | C# 8 | TESTS | 14 | 265 | 26624000 | ||
267114460 | IEluan | C | June 24, 2024, 1:36 a.m. | OK | GNU C11 | TESTS | 14 | 77 | 1536000 | ||
267111347 | crapcode | C | June 24, 2024, 12:24 a.m. | OK | GNU C11 | TESTS | 14 | 93 | 204800 | ||
267087135 | Prachi_Dubey_29 | C | June 23, 2024, 6:06 p.m. | OK | GNU C11 | TESTS | 8 | 171 | 819200 | ||
267098416 | akshatsharma.sja | C | June 23, 2024, 8:14 p.m. | OK | GNU C11 | TESTS | 8 | 421 | 716800 | ||
267081400 | flicktoss | C | June 23, 2024, 5:22 p.m. | OK | Java 21 | TESTS | 8 | 296 | 512000 | ||
267078947 | half_blood_prince__ | C | June 23, 2024, 5:09 p.m. | OK | Java 21 | TESTS | 8 | 312 | 307200 | ||
267079736 | Alex_Toppo_06 | C | June 23, 2024, 5:13 p.m. | OK | Java 21 | TESTS | 8 | 312 | 1024000 | ||
267081552 | priyaroy3370 | C | June 23, 2024, 5:23 p.m. | OK | Java 21 | TESTS | 8 | 327 | 9420800 | ||
267130504 | Romanual | C | June 24, 2024, 5:29 a.m. | OK | Java 21 | TESTS | 14 | 343 | 1843200 | ||
267091903 | 1vanGo | C | June 23, 2024, 6:53 p.m. | OK | Java 21 | TESTS | 8 | 343 | 3686400 | ||
267126043 | Mg718 | C | June 24, 2024, 4:34 a.m. | OK | Java 21 | TESTS | 14 | 358 | 5427200 | ||
267090619 | penpencil0312 | C | June 23, 2024, 6:38 p.m. | OK | Java 21 | TESTS | 8 | 406 | 2867200 | ||
267109076 | aza161 | C | June 23, 2024, 11:27 p.m. | OK | Java 21 | TESTS | 14 | 421 | 3072000 | ||
267128280 | Aviralpatel_0526 | C | June 24, 2024, 5:02 a.m. | OK | Java 21 | TESTS | 14 | 421 | 6041600 | ||
267099067 | KaiboHuang | C | June 23, 2024, 8:23 p.m. | OK | Java 8 | TESTS | 8 | 202 | 0 | ||
267115634 | nikhil97agra | C | June 24, 2024, 2 a.m. | OK | Java 8 | TESTS | 14 | 233 | 0 | ||
267110638 | samuelX159 | C | June 24, 2024, 12:07 a.m. | OK | Java 8 | TESTS | 14 | 234 | 0 | ||
267104616 | samuelX159 | C | June 23, 2024, 9:55 p.m. | OK | Java 8 | TESTS | 14 | 264 | 1740800 | ||
267092884 | sdthakor.9465 | C | June 23, 2024, 7:04 p.m. | OK | Java 8 | TESTS | 8 | 265 | 0 | ||
267127705 | Artistic_code | C | June 24, 2024, 4:54 a.m. | OK | Java 8 | TESTS | 14 | 281 | 4300800 | ||
267110167 | MarPal | C | June 23, 2024, 11:54 p.m. | OK | Java 8 | TESTS | 14 | 296 | 0 | ||
267099039 | statucci | C | June 23, 2024, 8:22 p.m. | OK | Java 8 | TESTS | 8 | 312 | 1536000 | ||
267128694 | pranavpatil9876 | C | June 24, 2024, 5:07 a.m. | OK | Java 8 | TESTS | 14 | 327 | 3686400 | ||
267126511 | shenofusc | C | June 24, 2024, 4:39 a.m. | OK | Java 8 | TESTS | 14 | 327 | 8806400 | ||
267081424 | bio-duplex | C | June 23, 2024, 5:22 p.m. | OK | Kotlin 1.9 | TESTS | 8 | 405 | 5222400 | ||
267112989 | nafiulfatta | C | June 24, 2024, 1:04 a.m. | OK | Node.js | TESTS | 14 | 265 | 40755200 | ||
267098241 | coder_11 | C | June 23, 2024, 8:11 p.m. | OK | PyPy 3 | TESTS | 8 | 296 | 15974400 | ||
267082697 | ghoshashis545 | C | June 23, 2024, 5:31 p.m. | OK | PyPy 3 | TESTS | 8 | 327 | 15974400 | ||
267110740 | KingofCSES | C | June 24, 2024, 12:09 a.m. | OK | PyPy 3 | TESTS | 14 | 374 | 14233600 | ||
267128190 | thinkphp | C | June 24, 2024, 5:01 a.m. | OK | PyPy 3 | TESTS | 14 | 421 | 19456000 | ||
267078980 | karnyadav | C | June 23, 2024, 5:09 p.m. | OK | PyPy 3 | TESTS | 8 | 437 | 14336000 | ||
267087781 | Rakeshyamjala | C | June 23, 2024, 6:11 p.m. | OK | PyPy 3 | TESTS | 8 | 437 | 16793600 | ||
267082520 | else3141 | C | June 23, 2024, 5:30 p.m. | OK | PyPy 3 | TESTS | 8 | 468 | 14643200 | ||
267127736 | Aswathy_A_R | C | June 24, 2024, 4:55 a.m. | OK | PyPy 3 | TESTS | 14 | 468 | 30105600 | ||
267082309 | wizardrabbit | C | June 23, 2024, 5:28 p.m. | OK | PyPy 3 | TESTS | 8 | 561 | 18944000 | ||
267079962 | eyobworku | C | June 23, 2024, 5:14 p.m. | OK | PyPy 3-64 | TESTS | 8 | 171 | 19558400 | ||
267098245 | singh.eureka | C | June 23, 2024, 8:11 p.m. | OK | PyPy 3-64 | TESTS | 8 | 186 | 26828800 | ||
267084935 | InHng_ | C | June 23, 2024, 5:48 p.m. | OK | PyPy 3-64 | TESTS | 8 | 187 | 27955200 | ||
267086232 | youngsuko | C | June 23, 2024, 5:59 p.m. | OK | PyPy 3-64 | TESTS | 8 | 202 | 21606400 | ||
267091272 | DeadMan69 | C | June 23, 2024, 6:46 p.m. | OK | PyPy 3-64 | TESTS | 8 | 202 | 22220800 | ||
267107494 | NitroSpear | C | June 23, 2024, 10:51 p.m. | OK | PyPy 3-64 | TESTS | 14 | 202 | 28774400 | ||
267097413 | karnyadav | C | June 23, 2024, 8:01 p.m. | OK | PyPy 3-64 | TESTS | 8 | 217 | 27648000 | ||
267098598 | AndreiZherder | C | June 23, 2024, 8:16 p.m. | OK | PyPy 3-64 | TESTS | 8 | 218 | 18841600 | ||
267084746 | golomb | C | June 23, 2024, 5:47 p.m. | OK | PyPy 3-64 | TESTS | 8 | 218 | 22016000 | ||
267078745 | JinYuManTang | C | June 23, 2024, 5:08 p.m. | OK | PyPy 3-64 | TESTS | 8 | 218 | 23859200 | ||
267085545 | Amr_Almoghazy | C | June 23, 2024, 5:53 p.m. | OK | Python 3 | TESTS | 8 | 155 | 10854400 | ||
267086845 | __sig | C | June 23, 2024, 6:04 p.m. | OK | Python 3 | TESTS | 8 | 156 | 14028800 | ||
267097972 | karnyadav | C | June 23, 2024, 8:08 p.m. | OK | Python 3 | TESTS | 8 | 156 | 15462400 | ||
267097379 | karnyadav | C | June 23, 2024, 8 p.m. | OK | Python 3 | TESTS | 8 | 156 | 15564800 | ||
267081175 | yoniti | C | June 23, 2024, 5:21 p.m. | OK | Python 3 | TESTS | 8 | 171 | 10956800 | ||
267082881 | Fahad_119 | C | June 23, 2024, 5:32 p.m. | OK | Python 3 | TESTS | 8 | 171 | 12902400 | ||
267097308 | karnyadav | C | June 23, 2024, 7:59 p.m. | OK | Python 3 | TESTS | 8 | 171 | 13004800 | ||
267076232 | kohonovalex2008 | C | June 23, 2024, 5:02 p.m. | OK | Python 3 | TESTS | 8 | 171 | 14028800 | ||
267080207 | Mohtasim_Siddiqui | C | June 23, 2024, 5:15 p.m. | OK | Python 3 | TESTS | 8 | 171 | 14131200 | ||
267098348 | karnyadav | C | June 23, 2024, 8:13 p.m. | OK | Python 3 | TESTS | 8 | 171 | 15462400 | ||
267092034 | 0x81 | C | June 23, 2024, 6:55 p.m. | OK | Ruby 3 | TESTS | 8 | 468 | 22528000 |
Back to search problems