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 |
---|---|---|---|---|---|---|
1778 | Codeforces Round 848 (Div. 2) | FINISHED | False | 7200 | 62004262 | Feb. 1, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 8613 ) | C | Flexible String | PROGRAMMING | bitmasks brute force strings |
B'You have a string a and a string b . Both of the strings have length n . There are at most 10 different characters in the string a . You also have a set Q . Initially, the set Q is empty. You can apply the following operation on the string a any number of times: For example, Let the string a be " tt{abecca} ". We can do the following operations: You can apply any number of operations on a , but in the end, the set Q should contain at most k different characters. Under this constraint, you have to maximize the number of integer pairs (l, r) ( 1 <= q l <= q r <= q n ) such that a[l,r] = b[l,r] . Here, s[l,r] means the substring of string s starting at index l (inclusively) and ending at index r (inclusively). Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line contains two integers n and k ( 1 <= q n <= q 10^5 , 0 <= q k <= q 10 ) -- the length of the two strings and the limit on different characters in the set Q . The second line contains the string a of length n . There is at most 10 different characters in the string a . The last line contains the string b of length n . Both of the strings a and b contain only lowercase English letters. The sum of n over all test cases doesn 't exceed 10^5 . For each test case, print a single integer in a line, the maximum number of pairs (l, r) satisfying the constraints. In the first case, we can select index i = 3 and replace it with character c = tt{d} . All possible pairs (l,r) will be valid. In the second case, we can 't perform any operation. The 3 valid pairs (l,r) are: In the third case, we can choose index 2 and index 3 and replace them with the char'... |
Codeforces Round #848 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
191592918 | ruban | C | Feb. 1, 2023, 4:02 p.m. | OK | Delphi | TESTS | 28 | 670 | 69939200 | ||
191643723 | HeapUser.He | C | Feb. 2, 2023, 1:42 a.m. | OK | GNU C11 | TESTS | 29 | 109 | 512000 | ||
191601954 | you2lyou2 | C | Feb. 1, 2023, 4:31 p.m. | OK | GNU C11 | TESTS | 28 | 343 | 204800 | ||
191661346 | wackyIndian | C | Feb. 2, 2023, 5:45 a.m. | OK | GNU C11 | TESTS | 37 | 889 | 204800 | ||
191661253 | Umnikfan | C | Feb. 2, 2023, 5:44 a.m. | OK | GNU C11 | TESTS | 37 | 935 | 204800 | ||
191640426 | dcytrl | C | Feb. 2, 2023, 12:37 a.m. | OK | GNU C++14 | TESTS | 29 | 46 | 204800 | ||
191610531 | Belief_yfly | C | Feb. 1, 2023, 5:39 p.m. | OK | GNU C++14 | TESTS | 28 | 46 | 614400 | ||
191641607 | fjashufi | C | Feb. 2, 2023, 1:01 a.m. | OK | GNU C++14 | TESTS | 29 | 46 | 1024000 | ||
191647729 | YeahPotato | C | Feb. 2, 2023, 2:48 a.m. | OK | GNU C++14 | TESTS | 29 | 46 | 2560000 | ||
191645094 | Xianll | C | Feb. 2, 2023, 2:04 a.m. | OK | GNU C++14 | TESTS | 29 | 62 | 409600 | ||
191640832 | sunzz3183 | C | Feb. 2, 2023, 12:45 a.m. | OK | GNU C++14 | TESTS | 29 | 62 | 1024000 | ||
191652819 | asdfo123 | C | Feb. 2, 2023, 4:05 a.m. | OK | GNU C++14 | TESTS | 29 | 78 | 204800 | ||
191653225 | Xianll | C | Feb. 2, 2023, 4:11 a.m. | OK | GNU C++14 | TESTS | 36 | 78 | 204800 | ||
191640899 | sohan_ict | C | Feb. 2, 2023, 12:47 a.m. | OK | GNU C++14 | TESTS | 29 | 78 | 5836800 | ||
191640117 | MIKEFENG | C | Feb. 2, 2023, 12:31 a.m. | OK | GNU C++14 | TESTS | 29 | 93 | 204800 | ||
191595285 | gshsmuyaho | C | Feb. 1, 2023, 4:09 p.m. | OK | GNU C++17 | TESTS | 28 | 46 | 204800 | ||
191636104 | Hoff | C | Feb. 1, 2023, 10:46 p.m. | OK | GNU C++17 | TESTS | 29 | 46 | 716800 | ||
191594949 | SirajUddin | C | Feb. 1, 2023, 4:08 p.m. | OK | GNU C++17 | TESTS | 28 | 61 | 1126400 | ||
191627648 | AhmadT198 | C | Feb. 1, 2023, 8:22 p.m. | OK | GNU C++17 | TESTS | 29 | 62 | 512000 | ||
191631823 | pedrinho | C | Feb. 1, 2023, 9:24 p.m. | OK | GNU C++17 | TESTS | 29 | 62 | 512000 | ||
191595768 | dco | C | Feb. 1, 2023, 4:11 p.m. | OK | GNU C++17 | TESTS | 28 | 62 | 614400 | ||
191622575 | harman_69 | C | Feb. 1, 2023, 7:19 p.m. | OK | GNU C++17 | TESTS | 29 | 77 | 614400 | ||
191640246 | Marckess | C | Feb. 2, 2023, 12:34 a.m. | OK | GNU C++17 | TESTS | 29 | 78 | 512000 | ||
191630565 | Kumiko_senpai | C | Feb. 1, 2023, 9:04 p.m. | OK | GNU C++17 | TESTS | 29 | 78 | 512000 | ||
191592872 | kunj_patel | C | Feb. 1, 2023, 4:02 p.m. | OK | GNU C++17 | TESTS | 28 | 78 | 512000 | ||
191596090 | Andreasyan | C | Feb. 1, 2023, 4:12 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 46 | 204800 | ||
191602464 | sigmamale | C | Feb. 1, 2023, 4:32 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 62 | 512000 | ||
191638311 | Hytidel | C | Feb. 1, 2023, 11:42 p.m. | OK | GNU C++17 (64) | TESTS | 29 | 62 | 512000 | ||
191607861 | trainwithoutpain | C | Feb. 1, 2023, 5:25 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 62 | 1433600 | ||
191601386 | DoNotMoZheng | C | Feb. 1, 2023, 4:29 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 78 | 512000 | ||
191597907 | A-SOUL__AvA | C | Feb. 1, 2023, 4:18 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 78 | 2252800 | ||
191595772 | weakestOsuPlayer_244 | C | Feb. 1, 2023, 4:11 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 93 | 512000 | ||
191595159 | hihihi198 | C | Feb. 1, 2023, 4:09 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 93 | 1740800 | ||
191640393 | zhtg | C | Feb. 2, 2023, 12:36 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 93 | 3481600 | ||
191651916 | YaoLingF | C | Feb. 2, 2023, 3:51 a.m. | OK | GNU C++17 (64) | TESTS | 29 | 109 | 204800 | ||
191598333 | Im70tep | C | Feb. 1, 2023, 4:20 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 31 | 512000 | ||
191620748 | Nxxlt | C | Feb. 1, 2023, 6:59 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 31 | 614400 | ||
191609642 | FloatingOcean | C | Feb. 1, 2023, 5:34 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 307200 | ||
191611627 | ScarletS | C | Feb. 1, 2023, 5:46 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 409600 | ||
191614806 | LeOniD_ | C | Feb. 1, 2023, 6:07 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 409600 | ||
191648260 | hahahaha__ | C | Feb. 2, 2023, 2:56 a.m. | OK | GNU C++20 (64) | TESTS | 29 | 46 | 409600 | ||
191650012 | Simple_QAQ | C | Feb. 2, 2023, 3:22 a.m. | OK | GNU C++20 (64) | TESTS | 29 | 46 | 409600 | ||
191609863 | gzhulc | C | Feb. 1, 2023, 5:35 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 512000 | ||
191651179 | YOUNGMANOFxingye | C | Feb. 2, 2023, 3:40 a.m. | OK | GNU C++20 (64) | TESTS | 29 | 46 | 512000 | ||
191623436 | SarthakS1 | C | Feb. 1, 2023, 7:29 p.m. | OK | GNU C++20 (64) | TESTS | 29 | 46 | 512000 | ||
191599211 | shiro | C | Feb. 1, 2023, 4:22 p.m. | OK | Go | TESTS | 28 | 670 | 1126400 | ||
191593072 | asdfghjkl_12345 | C | Feb. 1, 2023, 4:03 p.m. | OK | Java 11 | TESTS | 28 | 389 | 0 | ||
191593539 | HeXecutor | C | Feb. 1, 2023, 4:04 p.m. | OK | Java 11 | TESTS | 28 | 623 | 0 | ||
191596893 | saurabh_kh | C | Feb. 1, 2023, 4:15 p.m. | OK | Java 11 | TESTS | 28 | 639 | 0 | ||
191616453 | samitdas03 | C | Feb. 1, 2023, 6:20 p.m. | OK | Java 11 | TESTS | 28 | 670 | 0 | ||
191613133 | Jagnath_Reddy | C | Feb. 1, 2023, 5:55 p.m. | OK | Java 11 | TESTS | 28 | 826 | 0 | ||
191597642 | UdeaJl1337 | C | Feb. 1, 2023, 4:17 p.m. | OK | Java 11 | TESTS | 28 | 1232 | 0 | ||
191629969 | pakkapapad | C | Feb. 1, 2023, 8:55 p.m. | OK | Java 11 | TESTS | 29 | 1247 | 0 | ||
191618005 | Prime369 | C | Feb. 1, 2023, 6:32 p.m. | OK | Java 11 | TESTS | 29 | 1419 | 0 | ||
191616775 | kribri | C | Feb. 1, 2023, 6:22 p.m. | OK | Java 11 | TESTS | 29 | 1590 | 0 | ||
191597787 | Tykonan | C | Feb. 1, 2023, 4:18 p.m. | OK | Java 11 | TESTS | 28 | 1980 | 0 | ||
191593690 | TCchen | C | Feb. 1, 2023, 4:04 p.m. | OK | Java 17 | TESTS | 28 | 280 | 409600 | ||
191625941 | this.is.shivamsingh | C | Feb. 1, 2023, 7:59 p.m. | OK | Java 17 | TESTS | 29 | 467 | 614400 | ||
191600028 | kkz666 | C | Feb. 1, 2023, 4:25 p.m. | OK | Java 17 | TESTS | 28 | 545 | 716800 | ||
191611093 | anubh4v | C | Feb. 1, 2023, 5:42 p.m. | OK | Java 17 | TESTS | 28 | 623 | 409600 | ||
191647829 | evwhitehouse | C | Feb. 2, 2023, 2:49 a.m. | OK | Java 17 | TESTS | 29 | 639 | 819200 | ||
191592668 | MrOtter | C | Feb. 1, 2023, 4:01 p.m. | OK | Java 17 | TESTS | 28 | 670 | 409600 | ||
191610227 | Restricted | C | Feb. 1, 2023, 5:37 p.m. | OK | Java 17 | TESTS | 28 | 1060 | 409600 | ||
191640757 | ahmedtawfik | C | Feb. 2, 2023, 12:44 a.m. | OK | Java 17 | TESTS | 29 | 1122 | 614400 | ||
191627152 | IanISam | C | Feb. 1, 2023, 8:16 p.m. | OK | Java 8 | TESTS | 29 | 295 | 0 | ||
191598882 | GR1ZLER | C | Feb. 1, 2023, 4:21 p.m. | OK | Java 8 | TESTS | 28 | 561 | 1331200 | ||
191634369 | lpychemistry | C | Feb. 1, 2023, 10:08 p.m. | OK | Java 8 | TESTS | 29 | 607 | 0 | ||
191615370 | bleach__ | C | Feb. 1, 2023, 6:11 p.m. | OK | Java 8 | TESTS | 28 | 607 | 0 | ||
191603150 | swarup_312 | C | Feb. 1, 2023, 4:34 p.m. | OK | Java 8 | TESTS | 28 | 607 | 0 | ||
191594851 | Cromyl | C | Feb. 1, 2023, 4:08 p.m. | OK | Java 8 | TESTS | 28 | 608 | 0 | ||
191598177 | 12312sa | C | Feb. 1, 2023, 4:19 p.m. | OK | Java 8 | TESTS | 28 | 701 | 0 | ||
191628140 | NerfThis | C | Feb. 1, 2023, 8:28 p.m. | OK | Java 8 | TESTS | 29 | 795 | 0 | ||
191631316 | Mouhssine | C | Feb. 1, 2023, 9:16 p.m. | OK | Java 8 | TESTS | 29 | 810 | 0 | ||
191627987 | Mouhssine | C | Feb. 1, 2023, 8:27 p.m. | OK | Java 8 | TESTS | 29 | 888 | 0 | ||
191627420 | hotkey | C | Feb. 1, 2023, 8:19 p.m. | OK | Kotlin 1.6 | TESTS | 29 | 1996 | 0 | ||
191625549 | CyberSnake | C | Feb. 1, 2023, 7:54 p.m. | OK | MS C++ 2017 | TESTS | 29 | 265 | 409600 | ||
191598543 | mark77 | C | Feb. 1, 2023, 4:20 p.m. | OK | MS C++ 2017 | TESTS | 28 | 265 | 2048000 | ||
191635029 | gaspar.kristijan | C | Feb. 1, 2023, 10:22 p.m. | OK | MS C++ 2017 | TESTS | 29 | 514 | 307200 | ||
191626046 | Vitru | C | Feb. 1, 2023, 8:01 p.m. | OK | MS C++ 2017 | TESTS | 29 | 686 | 409600 | ||
191629158 | skimono | C | Feb. 1, 2023, 8:43 p.m. | OK | MS C++ 2017 | TESTS | 29 | 1154 | 409600 | ||
191642189 | shasta0312 | C | Feb. 2, 2023, 1:13 a.m. | OK | Node.js | TESTS | 29 | 1497 | 7168000 | ||
191652582 | bpdolson | C | Feb. 2, 2023, 4:02 a.m. | OK | PyPy 3 | TESTS | 29 | 1013 | 7475200 | ||
191637071 | imnowhere | C | Feb. 1, 2023, 11:09 p.m. | OK | PyPy 3 | TESTS | 29 | 1138 | 10240000 | ||
191649316 | yupooh | C | Feb. 2, 2023, 3:11 a.m. | OK | PyPy 3 | TESTS | 29 | 1154 | 9420800 | ||
191612283 | welshman_11 | C | Feb. 1, 2023, 5:50 p.m. | OK | PyPy 3 | TESTS | 28 | 1184 | 10342400 | ||
191639734 | mdrm | C | Feb. 2, 2023, 12:22 a.m. | OK | PyPy 3 | TESTS | 29 | 1216 | 9625600 | ||
191593521 | bvf | C | Feb. 1, 2023, 4:04 p.m. | OK | PyPy 3 | TESTS | 28 | 1263 | 8601600 | ||
191610094 | BeBeBe66666 | C | Feb. 1, 2023, 5:36 p.m. | OK | PyPy 3 | TESTS | 28 | 1294 | 7884800 | ||
191610686 | BeBeBe66666 | C | Feb. 1, 2023, 5:40 p.m. | OK | PyPy 3 | TESTS | 28 | 1294 | 8089600 | ||
191611059 | BeBeBe66666 | C | Feb. 1, 2023, 5:42 p.m. | OK | PyPy 3 | TESTS | 28 | 1325 | 8908800 | ||
191662064 | bvf | C | Feb. 2, 2023, 5:54 a.m. | OK | PyPy 3 | TESTS | 37 | 1325 | 9113600 | ||
191633213 | gardengnome | C | Feb. 1, 2023, 9:47 p.m. | OK | PyPy 3-64 | TESTS | 29 | 374 | 9728000 | ||
191652849 | aman_m42 | C | Feb. 2, 2023, 4:06 a.m. | OK | PyPy 3-64 | TESTS | 29 | 374 | 11468800 | ||
191637639 | BrendanSGubbins | C | Feb. 1, 2023, 11:24 p.m. | OK | PyPy 3-64 | TESTS | 29 | 390 | 9728000 | ||
191619184 | abhijeet.panihar.cse20 | C | Feb. 1, 2023, 6:43 p.m. | OK | PyPy 3-64 | TESTS | 29 | 483 | 10137600 | ||
191642130 | maxliang | C | Feb. 2, 2023, 1:12 a.m. | OK | PyPy 3-64 | TESTS | 29 | 483 | 10854400 | ||
191593587 | Mechem-SEAW | C | Feb. 1, 2023, 4:04 p.m. | OK | PyPy 3-64 | TESTS | 28 | 514 | 13619200 | ||
191634887 | CaptainUknown | C | Feb. 1, 2023, 10:19 p.m. | OK | PyPy 3-64 | TESTS | 29 | 732 | 12800000 | ||
191631489 | kavorka | C | Feb. 1, 2023, 9:18 p.m. | OK | PyPy 3-64 | TESTS | 29 | 857 | 18944000 | ||
191594917 | raushnn | C | Feb. 1, 2023, 4:08 p.m. | OK | PyPy 3-64 | TESTS | 28 | 966 | 19251200 | ||
191650772 | rien | C | Feb. 2, 2023, 3:34 a.m. | OK | PyPy 3-64 | TESTS | 29 | 982 | 11059200 | ||
191629654 | liut | C | Feb. 1, 2023, 8:51 p.m. | OK | Rust 2021 | TESTS | 29 | 46 | 409600 | ||
191602446 | p-a-t | C | Feb. 1, 2023, 4:32 p.m. | OK | Rust 2021 | TESTS | 28 | 108 | 1228800 |
Back to search problems