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 |
---|---|---|---|---|---|---|
1837 | Educational Codeforces Round 149 (Rated for Div. 2) | FINISHED | False | 7200 | 46797899 | May 25, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 22211 ) | C | Best Binary String | PROGRAMMING | constructive algorithms greedy |
B'You are given a string s consisting of the characters 0, 1 and/or ?. Let 's call it a pattern. Let 's say that the binary string (a string where each character is either 0 or 1) matches the pattern if you can replace each character ? with 0 or 1 (for each character, the choice is independent) so that the strings become equal. For example, 0010 matches ?01?, but 010 doesn 't match 1??, ??, or ????. Let 's define the cost of the binary string as the minimum number of operations of the form "reverse an arbitrary contiguous substring of the string" required to sort the string in non-descending order. You have to find a binary string with the minimum possible cost among those that match the given pattern. If there are multiple answers, print any of them. The first line contains a single integer t ( 1 <= t <= 3 cdot 10^4 ) -- the number of test cases. The first and only line of each test case contains the string s ( 1 <= |s| <= 3 cdot 10^5 ) consisting of characters 0, 1, and/or ?. The sum of the string lengths over all test cases does not exceed 3 cdot 10^5 . For each test case, print a binary string with the minimum possible cost among those that match the given pattern. If there are multiple answers, print any of them. In the first test case of the example, the cost of the resulting string is 0 . In the second test case, the cost of the resulting string is 2 : we can reverse the substring from the 1 -st character to the 5 -th character, and we obtain the string 00101. Then we reverse the substring from the 3 -rd to the 4 -th character, and we obtain the string 00011, which is sorted in non-descending order. '... |
116752 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
207294355 | bluemegane | C | May 26, 2023, 1:08 a.m. | OK | C# 8 | TESTS | 7 | 233 | 22323200 | ||
207273309 | xDevo | C | May 25, 2023, 6:03 p.m. | OK | Clang++17 Diagnostics | TESTS | 7 | 140 | 13414400 | ||
207281665 | Fxalaaaaaa | C | May 25, 2023, 7:45 p.m. | OK | Clang++20 Diagnostics | TESTS | 7 | 327 | 15360000 | ||
207307150 | lalala. | C | May 26, 2023, 5:12 a.m. | OK | GNU C11 | TESTS | 7 | 31 | 307200 | ||
207274881 | astronom1cal | C | May 25, 2023, 6:18 p.m. | OK | GNU C11 | TESTS | 7 | 140 | 307200 | ||
207306889 | mahmudrashik | C | May 26, 2023, 5:08 a.m. | OK | GNU C11 | TESTS | 7 | 140 | 1024000 | ||
207306406 | cugnanggu | C | May 26, 2023, 5:01 a.m. | OK | GNU C11 | TESTS | 7 | 249 | 307200 | ||
207261287 | paramparsewar | C | May 25, 2023, 4:37 p.m. | OK | GNU C11 | TESTS | 7 | 1153 | 614400 | ||
207288571 | c0derro | C | May 25, 2023, 9:58 p.m. | OK | GNU C11 | TESTS | 7 | 1465 | 614400 | ||
207292981 | E-ray | C | May 26, 2023, 12:29 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 307200 | ||
207290926 | luoZH111 | C | May 25, 2023, 11:16 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 307200 | ||
207261174 | Wolnest | C | May 25, 2023, 4:37 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 307200 | ||
207306153 | nowaykkk | C | May 26, 2023, 4:57 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207293414 | FredericM | C | May 26, 2023, 12:44 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207290010 | myst-6 | C | May 25, 2023, 10:41 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207279177 | TheAbsoluteKiller | C | May 25, 2023, 7:07 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207277438 | rishi-afk | C | May 25, 2023, 6:45 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207273292 | xDevo | C | May 25, 2023, 6:03 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207271292 | I__am__I | C | May 25, 2023, 5:45 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 1024000 | ||
207299675 | hl666 | C | May 26, 2023, 3:06 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 307200 | ||
207262371 | muhammadabrar | C | May 25, 2023, 4:40 p.m. | OK | GNU C++17 | TESTS | 7 | 15 | 307200 | ||
207295408 | texas2 | C | May 26, 2023, 1:35 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 307200 | ||
207306592 | pradhumnsharma2002 | C | May 26, 2023, 5:04 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207308985 | jwjXin | C | May 26, 2023, 5:37 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207309495 | bkifhr6 | C | May 26, 2023, 5:44 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207310284 | varun_1008 | C | May 26, 2023, 5:54 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207309387 | noob-programmer | C | May 26, 2023, 5:43 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207308494 | snavneet561 | C | May 26, 2023, 5:31 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207307566 | NishantS | C | May 26, 2023, 5:18 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 1024000 | ||
207307293 | kjhhjki | C | May 26, 2023, 5:14 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 307200 | ||
207293047 | HM220809 | C | May 26, 2023, 12:31 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207308971 | ujjvalsaini | C | May 26, 2023, 5:37 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207301740 | poxiao0 | C | May 26, 2023, 3:41 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207297815 | consistent_17 | C | May 26, 2023, 2:30 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207296750 | DOngPH19 | C | May 26, 2023, 2:06 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207292264 | zlxFTH | C | May 26, 2023, 12:06 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207290365 | MarcosK | C | May 25, 2023, 10:54 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207287534 | enslaved | C | May 25, 2023, 9:31 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207284347 | nicksms | C | May 25, 2023, 8:28 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 1024000 | ||
207289180 | secret77777 | C | May 25, 2023, 10:15 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 1024000 | ||
207306097 | San_Cai | C | May 26, 2023, 4:57 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 1024000 | ||
207304398 | Lazy.JPG | C | May 26, 2023, 4:30 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 1024000 | ||
207292947 | Shupto_006 | C | May 26, 2023, 12:28 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 1024000 | ||
207276537 | catkun | C | May 25, 2023, 6:35 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 1024000 | ||
207283303 | leonid_perminov | C | May 25, 2023, 8:10 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 1024000 | ||
207298042 | LXH-cat | C | May 26, 2023, 2:34 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 15 | 307200 | ||
207308299 | webmaster | C | May 26, 2023, 5:28 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 15 | 614400 | ||
207310260 | ..vince | C | May 26, 2023, 5:54 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 15 | 1024000 | ||
207310555 | ayush_r01 | C | May 26, 2023, 5:58 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 15 | 1024000 | ||
207282523 | sarvesh_bawari | C | May 25, 2023, 7:58 p.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
207282556 | sunaj | C | May 25, 2023, 7:59 p.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
207289859 | DOOMJUICE | C | May 25, 2023, 10:36 p.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
207284382 | ash_79 | C | May 25, 2023, 8:28 p.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | ||
207300402 | ilasiawo | C | May 26, 2023, 3:18 a.m. | OK | Java 11 | TESTS | 7 | 218 | 0 | ||
207264695 | enuguru_2002 | C | May 25, 2023, 4:54 p.m. | OK | Java 11 | TESTS | 7 | 233 | 5836800 | ||
207267257 | kasiru_69 | C | May 25, 2023, 5:10 p.m. | OK | Java 11 | TESTS | 7 | 373 | 0 | ||
207273763 | g_square | C | May 25, 2023, 6:07 p.m. | OK | Java 11 | TESTS | 7 | 405 | 0 | ||
207295604 | Nanthakumar06 | C | May 26, 2023, 1:39 a.m. | OK | Java 11 | TESTS | 7 | 420 | 0 | ||
207282418 | _nirjhor | C | May 25, 2023, 7:57 p.m. | OK | Java 11 | TESTS | 7 | 420 | 0 | ||
207307140 | q2045891621. | C | May 26, 2023, 5:12 a.m. | OK | Java 17 | TESTS | 7 | 202 | 204800 | ||
207275543 | MagentaCobra | C | May 25, 2023, 6:24 p.m. | OK | Java 17 | TESTS | 7 | 202 | 307200 | ||
207268914 | abhayptsr | C | May 25, 2023, 5:23 p.m. | OK | Java 17 | TESTS | 7 | 202 | 716800 | ||
207275925 | Suraj1607 | C | May 25, 2023, 6:28 p.m. | OK | Java 17 | TESTS | 7 | 217 | 409600 | ||
207297982 | happy_rose | C | May 26, 2023, 2:33 a.m. | OK | Java 17 | TESTS | 7 | 218 | 307200 | ||
207262329 | SuprHUlk | C | May 25, 2023, 4:40 p.m. | OK | Java 17 | TESTS | 7 | 233 | 512000 | ||
207274741 | Vrutik_2809 | C | May 25, 2023, 6:16 p.m. | OK | Java 17 | TESTS | 7 | 248 | 0 | ||
207309735 | rishabhkumrawat02 | C | May 26, 2023, 5:47 a.m. | OK | Java 17 | TESTS | 7 | 249 | 512000 | ||
207280633 | AKhacks | C | May 25, 2023, 7:29 p.m. | OK | Java 17 | TESTS | 7 | 264 | 102400 | ||
207297267 | bleach__ | C | May 26, 2023, 2:18 a.m. | OK | Java 17 | TESTS | 7 | 280 | 5324800 | ||
207263380 | NerfThis | C | May 25, 2023, 4:46 p.m. | OK | Java 8 | TESTS | 7 | 109 | 0 | ||
207297058 | chuquwan9964 | C | May 26, 2023, 2:13 a.m. | OK | Java 8 | TESTS | 7 | 124 | 3276800 | ||
207300324 | QianCCC | C | May 26, 2023, 3:17 a.m. | OK | Java 8 | TESTS | 7 | 155 | 0 | ||
207266612 | lpychemistry | C | May 25, 2023, 5:05 p.m. | OK | Java 8 | TESTS | 7 | 155 | 0 | ||
207264195 | Juhaied_nabid | C | May 25, 2023, 4:51 p.m. | OK | Java 8 | TESTS | 7 | 171 | 0 | ||
207263756 | WvemiY9 | C | May 25, 2023, 4:49 p.m. | OK | Java 8 | TESTS | 7 | 187 | 0 | ||
207261227 | d_rocky | C | May 25, 2023, 4:37 p.m. | OK | Java 8 | TESTS | 7 | 358 | 0 | ||
207271177 | depurador_ik | C | May 25, 2023, 5:44 p.m. | OK | Java 8 | TESTS | 7 | 1107 | 38297600 | ||
207296672 | ab411 | C | May 26, 2023, 2:04 a.m. | OK | Java 8 | TESTS | 7 | 1138 | 0 | ||
207284580 | skimono | C | May 25, 2023, 8:32 p.m. | OK | MS C++ 2017 | TESTS | 7 | 31 | 1126400 | ||
207283772 | NajlSadek | C | May 25, 2023, 8:18 p.m. | OK | MS C++ 2017 | TESTS | 7 | 108 | 1024000 | ||
207263597 | Vitru | C | May 25, 2023, 4:48 p.m. | OK | MS C++ 2017 | TESTS | 7 | 108 | 1024000 | ||
207297968 | SackSia | C | May 26, 2023, 2:33 a.m. | OK | MS C++ 2017 | TESTS | 7 | 109 | 21094400 | ||
207273006 | EbuYandex | C | May 25, 2023, 6 p.m. | OK | MS C++ 2017 | TESTS | 7 | 139 | 1024000 | ||
207273583 | Yash_Nandwana | C | May 25, 2023, 6:05 p.m. | OK | PyPy 3 | TESTS | 7 | 156 | 15872000 | ||
207289614 | random__person | C | May 25, 2023, 10:29 p.m. | OK | PyPy 3 | TESTS | 7 | 170 | 11980800 | ||
207259894 | hxu10 | C | May 25, 2023, 4:33 p.m. | OK | PyPy 3 | TESTS | 7 | 202 | 14848000 | ||
207268553 | DHF_20 | C | May 25, 2023, 5:20 p.m. | OK | PyPy 3 | TESTS | 7 | 405 | 11776000 | ||
207268292 | DHF_20 | C | May 25, 2023, 5:18 p.m. | OK | PyPy 3 | TESTS | 7 | 420 | 22630400 | ||
207260221 | Mahdieh_Naderi | C | May 25, 2023, 4:33 p.m. | OK | PyPy 3 | TESTS | 7 | 498 | 12902400 | ||
207263191 | w313880557 | C | May 25, 2023, 4:45 p.m. | OK | PyPy 3 | TESTS | 7 | 530 | 13004800 | ||
207261481 | harshini.paranjape | C | May 25, 2023, 4:37 p.m. | OK | PyPy 3 | TESTS | 7 | 545 | 11264000 | ||
207310334 | sakshigupta | C | May 26, 2023, 5:55 a.m. | OK | PyPy 3 | TESTS | 7 | 607 | 10444800 | ||
207287012 | VidGa | C | May 25, 2023, 9:18 p.m. | OK | PyPy 3 | TESTS | 7 | 685 | 14336000 | ||
207278688 | Div2003 | C | May 25, 2023, 7:01 p.m. | OK | PyPy 3-64 | TESTS | 7 | 108 | 16998400 | ||
207291355 | pennymagic156 | C | May 25, 2023, 11:34 p.m. | OK | PyPy 3-64 | TESTS | 7 | 109 | 15974400 | ||
207270709 | alexwice | C | May 25, 2023, 5:40 p.m. | OK | PyPy 3-64 | TESTS | 7 | 109 | 19865600 | ||
207267163 | AAE | C | May 25, 2023, 5:09 p.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 26009600 | ||
207295746 | broshen | C | May 26, 2023, 1:42 a.m. | OK | PyPy 3-64 | TESTS | 7 | 139 | 19251200 | ||
207310141 | Aravind | C | May 26, 2023, 5:52 a.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 17920000 | ||
207262538 | yingkui | C | May 25, 2023, 4:41 p.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 22220800 | ||
207280792 | Mohamed_Hamed | C | May 25, 2023, 7:31 p.m. | OK | PyPy 3-64 | TESTS | 7 | 155 | 20172800 | ||
207273937 | Khatarnak_Khandu | C | May 25, 2023, 6:09 p.m. | OK | PyPy 3-64 | TESTS | 7 | 155 | 22016000 | ||
207293277 | eugalt | C | May 26, 2023, 12:39 a.m. | OK | PyPy 3-64 | TESTS | 7 | 171 | 9625600 | ||
207265164 | mega_bot | C | May 25, 2023, 4:56 p.m. | OK | Python 3 | TESTS | 7 | 124 | 1945600 | ||
207292857 | eugalt | C | May 26, 2023, 12:25 a.m. | OK | Python 3 | TESTS | 7 | 124 | 2560000 | ||
207274277 | omarkurde | C | May 25, 2023, 6:12 p.m. | OK | Python 3 | TESTS | 7 | 139 | 1843200 | ||
207298777 | Acaax | C | May 26, 2023, 2:48 a.m. | OK | Python 3 | TESTS | 7 | 140 | 3993600 | ||
207305656 | zhong_father | C | May 26, 2023, 4:50 a.m. | OK | Python 3 | TESTS | 7 | 156 | 5939200 | ||
207260281 | PhysicsBoyAC | C | May 25, 2023, 4:34 p.m. | OK | Python 3 | TESTS | 7 | 171 | 3584000 | ||
207261820 | maazkhazi7 | C | May 25, 2023, 4:38 p.m. | OK | Python 3 | TESTS | 7 | 171 | 5939200 | ||
207297459 | wzl722 | C | May 26, 2023, 2:22 a.m. | OK | Python 3 | TESTS | 7 | 171 | 11673600 | ||
207275041 | nvllable | C | May 25, 2023, 6:19 p.m. | OK | Python 3 | TESTS | 7 | 248 | 3276800 | ||
207302103 | adlashiva | C | May 26, 2023, 3:49 a.m. | OK | Python 3 | TESTS | 7 | 249 | 3379200 | ||
207279281 | matheusdacach | C | May 25, 2023, 7:09 p.m. | OK | Rust 2021 | TESTS | 7 | 264 | 2560000 | ||
207284510 | kost | C | May 25, 2023, 8:30 p.m. | OK | Rust 2021 | TESTS | 7 | 280 | 1331200 |
Back to search problems