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 |
---|---|---|---|---|---|---|
1809 | Educational Codeforces Round 145 (Rated for Div. 2) | FINISHED | False | 7200 | 52241099 | March 23, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 6391 ) | D | Binary String Sorting | PROGRAMMING | binary search dp greedy |
B"You are given a binary string s consisting of only characters 0 and/or 1. You can perform several operations on this string (possibly zero). There are two types of operations: Your task is to calculate the minimum number of coins required to sort the string s in non-decreasing order (i. xe2 x80 x89e. transform s so that s_1 <= s_2 <= ... <= s_m , where m is the length of the string after applying all operations). An empty string is also considered sorted in non-decreasing order. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The only line of each test case contains the string s ( 1 <= |s| <= 3 cdot 10^5 ), consisting of only characters 0 and/or 1. The sum of lengths of all given strings doesn't exceed 3 cdot 10^5 . For each test case, print a single integer -- the minimum number of coins required to sort the string s in non-decreasing order. In the first example, you have to remove the 1 -st element, so the string becomes equal to 00. In the second example, the string is already sorted. In the third example, you have to swap the 2 -nd and the 3 -rd elements, so the string becomes equal to 0011. In the fourth example, you have to swap the 3 -rd and the 4 -th elements, so the string becomes equal to 00011101, and then remove the 7 -th element, so the string becomes equal to 0001111. In the fifth example, you have to remove the 1 -st element, so the string becomes equal to 001101, and then remove the 5 -th element, so the string becomes equal to 00111. In the sixth example, the string is already sorted. "... |
114300 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
198884219 | Twilight_Shimmer | D | March 24, 2023, 2:41 a.m. | OK | Clang++17 Diagnostics | TESTS | 8 | 93 | 17817600 | ||
198887357 | broshen | D | March 24, 2023, 3:41 a.m. | OK | Clang++17 Diagnostics | TESTS | 8 | 296 | 25497600 | ||
198892278 | 666niko | D | March 24, 2023, 5 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 307200 | ||
198876527 | 2018ljw | D | March 24, 2023, 12:01 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 307200 | ||
198834988 | skypowerr | D | March 23, 2023, 5:02 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 307200 | ||
198875405 | j30 | D | March 23, 2023, 11:39 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 1024000 | ||
198855704 | prateeek123 | D | March 23, 2023, 7:45 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 1024000 | ||
198853127 | Mahadi_Rooman | D | March 23, 2023, 7:19 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 1024000 | ||
198842053 | DJ_2.0 | D | March 23, 2023, 5:44 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 1024000 | ||
198882860 | onlycre | D | March 24, 2023, 2:11 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 1433600 | ||
198876215 | whyself | D | March 23, 2023, 11:54 p.m. | OK | GNU C++14 | TESTS | 8 | 15 | 2662400 | ||
198881042 | Xu_Hongxi | D | March 24, 2023, 1:31 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 2764800 | ||
198887318 | nforget | D | March 24, 2023, 3:41 a.m. | OK | GNU C++17 | TESTS | 8 | 15 | 307200 | ||
198890951 | dsak1aa | D | March 24, 2023, 4:42 a.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198888774 | hardik_836 | D | March 24, 2023, 4:08 a.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198888410 | ge_zhan | D | March 24, 2023, 4:02 a.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198876517 | Georgegg | D | March 24, 2023, midnight | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198867499 | Zeuidon | D | March 23, 2023, 9:36 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198867366 | KiFaH_HeLaL | D | March 23, 2023, 9:35 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198841476 | neo11235 | D | March 23, 2023, 5:40 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198832082 | rahul_iit_code | D | March 23, 2023, 4:48 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198830923 | doing | D | March 23, 2023, 4:43 p.m. | OK | GNU C++17 | TESTS | 8 | 15 | 1024000 | ||
198846127 | weakestOsuPlayer_244 | D | March 23, 2023, 6:14 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 1024000 | ||
198838969 | anhkha2003 | D | March 23, 2023, 5:24 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 1024000 | ||
198827442 | mePranav | D | March 23, 2023, 4:33 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 1024000 | ||
198883133 | Mryange | D | March 24, 2023, 2:16 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 1638400 | ||
198893311 | s8x | D | March 24, 2023, 5:12 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 2252800 | ||
198890937 | Husanboy | D | March 24, 2023, 4:42 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 3481600 | ||
198886004 | Once_I_Liked_AGirl | D | March 24, 2023, 3:17 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 3481600 | ||
198881410 | PurpleCrayon | D | March 24, 2023, 1:39 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 3481600 | ||
198875396 | xiaoyiru | D | March 23, 2023, 11:38 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 3481600 | ||
198868029 | juliany2 | D | March 23, 2023, 9:42 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 15 | 3481600 |
Back to search problems