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 |
---|---|---|---|---|---|---|
1860 | Educational Codeforces Round 153 (Rated for Div. 2) | FINISHED | False | 7200 | 39540299 | Aug. 17, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 3046 ) | D | Balanced String | PROGRAMMING | bitmasks constructive algorithms dp |
B"You are given a binary string s (a binary string is a string consisting of characters 0 and/or 1). Let's call a binary string balanced if the number of subsequences 01 (the number of indices i and j such that 1 <= i < j <= n , s_i=0 and s_j=1 ) equals to the number of subsequences 10 (the number of indices k and l such that 1 <= k < l <= n , s_k=1 and s_l=0 ) in it. For example, the string 1000110 is balanced, because both the number of subsequences 01 and the number of subsequences 10 are equal to 6 . On the other hand, 11010 is not balanced, because the number of subsequences 01 is 1 , but the number of subsequences 10 is 5 . You can perform the following operation any number of times: choose two characters in s and swap them. Your task is to calculate the minimum number of operations to make the string s balanced. The only line contains the string s ( 3 <= |s| <= 100 ) consisting of characters 0 and/or 1. Additional constraint on the input: the string s can be made balanced. Print a single integer -- the minimum number of swap operations to make the string s balanced. In the first example, the string is already balanced, the number of both 01 and 10 is equal to 1 . In the second example, the string is already balanced, the number of both 01 and 10 is equal to 6 . In the third example, one of the possible answers is the following one: 11010 rightarrow 01110. After that, the number of both 01 and 10 is equal to 3 . In the fourth example, one of the possible answers is the following one: 11001100 rightarrow 11001010 rightarrow 11000011. After that, the number of both 01 and 10 is equal to 8 . "... |
Educational Codeforces Round 153 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
219347003 | rainboy | D | Aug. 17, 2023, 4:43 p.m. | OK | GNU C11 | TESTS | 19 | 31 | 2048000 | ||
219396134 | crpQwQ | D | Aug. 18, 2023, 4:12 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 0 | ||
219398715 | flysnow | D | Aug. 18, 2023, 4:48 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 0 | ||
219383216 | suibian_xiaozhao | D | Aug. 18, 2023, 12:29 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 716800 | ||
219386582 | ASincereCoder | D | Aug. 18, 2023, 1:40 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 1945600 | ||
219386699 | ASincereCoder | D | Aug. 18, 2023, 1:42 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 1945600 | ||
219391356 | Dannlca | D | Aug. 18, 2023, 3:01 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 2048000 | ||
219391281 | Dannlca | D | Aug. 18, 2023, 3 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 2048000 | ||
219391152 | Dannlca | D | Aug. 18, 2023, 2:58 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 2048000 | ||
219391499 | Wzh134009181 | D | Aug. 18, 2023, 3:03 a.m. | OK | GNU C++14 | TESTS | 19 | 15 | 2048000 | ||
219355549 | Suwan | D | Aug. 17, 2023, 5:33 p.m. | OK | GNU C++14 | TESTS | 19 | 15 | 2150400 | ||
219399012 | dreamath | D | Aug. 18, 2023, 4:52 a.m. | OK | GNU C++17 | TESTS | 19 | 15 | 0 | ||
219393938 | 4444vdgdgb | D | Aug. 18, 2023, 3:39 a.m. | OK | GNU C++17 | TESTS | 19 | 15 | 0 | ||
219404019 | Samadeol | D | Aug. 18, 2023, 5:53 a.m. | OK | GNU C++17 | TESTS | 19 | 15 | 0 | ||
219389166 | hIDDEn4335 | D | Aug. 18, 2023, 2:25 a.m. | OK | GNU C++17 | TESTS | 19 | 15 | 4198400 | ||
219347427 | shihoghmean | D | Aug. 17, 2023, 4:44 p.m. | OK | GNU C++17 | TESTS | 19 | 30 | 110694400 | ||
219355147 | fallleaves07 | D | Aug. 17, 2023, 5:30 p.m. | OK | GNU C++17 | TESTS | 19 | 31 | 204800 | ||
219351401 | mikky20 | D | Aug. 17, 2023, 5:04 p.m. | OK | GNU C++17 | TESTS | 19 | 31 | 307200 | ||
219353704 | mikky20 | D | Aug. 17, 2023, 5:19 p.m. | OK | GNU C++17 | TESTS | 19 | 31 | 307200 | ||
219383463 | yyytf__ | D | Aug. 18, 2023, 12:35 a.m. | OK | GNU C++17 | TESTS | 19 | 31 | 716800 | ||
219385328 | steven2022 | D | Aug. 18, 2023, 1:17 a.m. | OK | GNU C++17 | TESTS | 19 | 31 | 716800 | ||
219355181 | VnoiJudge | D | Aug. 17, 2023, 5:30 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 31 | 1536000 | ||
219404161 | h_squared | D | Aug. 18, 2023, 5:55 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 31 | 2355200 | ||
219386774 | konb1 | D | Aug. 18, 2023, 1:43 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 31 | 4608000 | ||
219345666 | Whereismybrain | D | Aug. 17, 2023, 4:38 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 31 | 8806400 | ||
219349722 | Harmony_ | D | Aug. 17, 2023, 4:55 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 31 | 30310400 | ||
219351056 | svoom | D | Aug. 17, 2023, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 204800 | ||
219380789 | lunchbox | D | Aug. 17, 2023, 11:14 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 1024000 | ||
219351033 | Mhamad_aboaljood | D | Aug. 17, 2023, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 27545600 | ||
219349683 | EternalAlexander | D | Aug. 17, 2023, 4:55 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 61 | 110592000 | ||
219392201 | chanhchuong0702 | D | Aug. 18, 2023, 3:14 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 62 | 8396800 | ||
219398867 | bkdn23.SicilianDragonLvr | D | Aug. 18, 2023, 4:50 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 0 | 0 | ||
219394052 | microne_mzx | D | Aug. 18, 2023, 3:41 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 0 | ||
219371552 | brenner1 | D | Aug. 17, 2023, 8:23 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 0 | ||
219395102 | Hritik12 | D | Aug. 18, 2023, 3:55 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 0 | ||
219382923 | hhhyh | D | Aug. 18, 2023, 12:21 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 409600 | ||
219379217 | Thallium54 | D | Aug. 17, 2023, 10:30 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 409600 | ||
219402789 | YYYLLL2021 | D | Aug. 18, 2023, 5:38 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 614400 | ||
219350166 | UUUNknown | D | Aug. 17, 2023, 4:57 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 716800 | ||
219360844 | flashmt | D | Aug. 17, 2023, 6:18 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 716800 | ||
219402530 | YYYLLL2021 | D | Aug. 18, 2023, 5:35 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 15 | 921600 | ||
219395743 | FierteDeCeylan | D | Aug. 18, 2023, 4:06 a.m. | OK | Java 11 | TESTS | 19 | 187 | 0 | ||
219346610 | profchi | D | Aug. 17, 2023, 4:41 p.m. | OK | Java 11 | TESTS | 19 | 390 | 146534400 | ||
219350352 | ffaann | D | Aug. 17, 2023, 4:58 p.m. | OK | Java 17 | TESTS | 19 | 202 | 409600 | ||
219347889 | kk2525 | D | Aug. 17, 2023, 4:46 p.m. | OK | Java 17 | TESTS | 19 | 218 | 409600 | ||
219390023 | wizardleen | D | Aug. 18, 2023, 2:39 a.m. | OK | Java 17 | TESTS | 19 | 264 | 8704000 | ||
219389812 | dzhi | D | Aug. 18, 2023, 2:35 a.m. | OK | Java 17 | TESTS | 19 | 1122 | 29184000 | ||
219382771 | 1091857051 | D | Aug. 18, 2023, 12:17 a.m. | OK | Java 8 | TESTS | 19 | 109 | 0 | ||
219386239 | cc4414 | D | Aug. 18, 2023, 1:34 a.m. | OK | Java 8 | TESTS | 19 | 187 | 37888000 | ||
219343797 | Eslam_Ahmed | D | Aug. 17, 2023, 4:34 p.m. | OK | Java 8 | TESTS | 19 | 374 | 77516800 | ||
219401051 | syksykCCC | D | Aug. 18, 2023, 5:17 a.m. | OK | PyPy 3-64 | TESTS | 19 | 77 | 1843200 | ||
219368661 | gardengnome | D | Aug. 17, 2023, 7:42 p.m. | OK | PyPy 3-64 | TESTS | 19 | 93 | 3584000 | ||
219385639 | JinYuManTang | D | Aug. 18, 2023, 1:23 a.m. | OK | PyPy 3-64 | TESTS | 19 | 202 | 6758400 | ||
219391102 | JinYuManTang | D | Aug. 18, 2023, 2:57 a.m. | OK | PyPy 3-64 | TESTS | 19 | 233 | 6758400 | ||
219381479 | cybsbbb | D | Aug. 17, 2023, 11:37 p.m. | OK | PyPy 3-64 | TESTS | 19 | 280 | 14950400 | ||
219359986 | yuki_keshiki | D | Aug. 17, 2023, 6:10 p.m. | OK | PyPy 3-64 | TESTS | 19 | 311 | 17100800 | ||
219348341 | yghygh123 | D | Aug. 17, 2023, 4:48 p.m. | OK | PyPy 3-64 | TESTS | 19 | 607 | 249446400 | ||
219347676 | mas_sa | D | Aug. 17, 2023, 4:45 p.m. | OK | PyPy 3-64 | TESTS | 19 | 1872 | 50380800 | ||
219386914 | ilyshana | D | Aug. 18, 2023, 1:46 a.m. | OK | Rust 2021 | TESTS | 19 | 31 | 1433600 |
Back to search problems