Educational Codeforces Round 122 (Rated for Div. 2)

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
1633 Educational Codeforces Round 122 (Rated for Div. 2) FINISHED False 7200 93626663 Jan. 31, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 28004 ) B Minority PROGRAMMING greedy

B'You are given a string s , consisting only of characters '0 ' and '1 '. You have to choose a contiguous substring of s and remove all occurrences of the character, which is a strict minority in it, from the substring. That is, if the amount of '0 's in the substring is strictly smaller than the amount of '1 's, remove all occurrences of '0 ' from the substring. If the amount of '1 's is strictly smaller than the amount of '0 's, remove all occurrences of '1 '. If the amounts are the same, do nothing. You have to apply the operation exactly once. What is the maximum amount of characters that can be removed? The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The only line of each testcase contains a non-empty string s , consisting only of characters '0 ' and '1 '. The length of s doesn 't exceed 2 cdot 10^5 . The total length of strings s over all testcases doesn 't exceed 2 cdot 10^5 . For each testcase, print a single integer -- the maximum amount of characters that can be removed after applying the operation exactly once. In the first testcase, you can choose substrings "0", "1" or "01". In "0" the amount of '0 ' is 1 , the amount of '1 ' is 0 . '1 ' is a strict minority, thus all occurrences of it are removed from the substring. However, since there were 0 of them, nothing changes. Same for "1". And in "01" neither of '0 ' or '1 ' is a strict minority. Thus, nothing changes. So there is no way to remove any characters. In the second testcase, you can choose substring "10101010101". It contains 5 characters '0 ' and 6 characters '1 '. '0 ' is a strict minority. Thus, you can remove all its occurrences. There exist other substrings that produce the same answer. In the third testcase, you can choose substring "011000100". It contains 6 characters '0 ' and 3 characters '1 '. '1 ' is a strict minority. Thus, you can remove all its occurrences. '...

Tutorials

99539

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
144787311 wudima7 B Feb. 1, 2022, 1:17 a.m. OK Clang++17 Diagnostics TESTS 14 93 13004800
144763622 fahimfarhad123 B Jan. 31, 2022, 5:19 p.m. OK GNU C11 TESTS 14 31 2048000
144793980 emeraldbeacon B Feb. 1, 2022, 4:24 a.m. OK GNU C11 TESTS 14 46 204800
144793772 Jarin_Tasnim_Hridy B Feb. 1, 2022, 4:21 a.m. OK GNU C11 TESTS 14 46 204800
144791090 SkyWolfy B Feb. 1, 2022, 3:28 a.m. OK GNU C11 TESTS 14 78 614400
144770960 _Demon_ B Jan. 31, 2022, 6:19 p.m. OK GNU C++14 TESTS 14 0 512000
144764819 adikajale_123 B Jan. 31, 2022, 5:27 p.m. OK GNU C++14 TESTS 14 0 512000
144790589 crepuscular B Feb. 1, 2022, 3:17 a.m. OK GNU C++14 TESTS 14 0 512000
144791415 Just_coding_ B Feb. 1, 2022, 3:36 a.m. OK GNU C++14 TESTS 14 0 512000
144756635 aline.ly B Jan. 31, 2022, 4:42 p.m. OK GNU C++14 TESTS 14 15 204800
144788796 FSTAutoMaton B Feb. 1, 2022, 2:24 a.m. OK GNU C++14 TESTS 14 15 204800
144790629 Suffocating B Feb. 1, 2022, 3:18 a.m. OK GNU C++14 TESTS 14 15 307200
144789612 keep1earning B Feb. 1, 2022, 2:51 a.m. OK GNU C++14 TESTS 14 15 307200
144799686 alpha_022 B Feb. 1, 2022, 6:02 a.m. OK GNU C++14 TESTS 14 15 512000
144799407 Kira_0999 B Feb. 1, 2022, 5:59 a.m. OK GNU C++14 TESTS 14 15 512000
144787414 Anurag203 B Feb. 1, 2022, 1:23 a.m. OK GNU C++17 TESTS 14 0 512000
144781782 Bam-----What B Jan. 31, 2022, 9:01 p.m. OK GNU C++17 TESTS 14 0 512000
144777247 star.lord B Jan. 31, 2022, 7:38 p.m. OK GNU C++17 TESTS 14 0 512000
144763814 windu B Jan. 31, 2022, 5:20 p.m. OK GNU C++17 TESTS 14 0 512000
144759252 devanshu-08 B Jan. 31, 2022, 4:53 p.m. OK GNU C++17 TESTS 14 0 512000
144757520 raj79 B Jan. 31, 2022, 4:46 p.m. OK GNU C++17 TESTS 14 0 512000
144799054 2-qiym B Feb. 1, 2022, 5:55 a.m. OK GNU C++17 TESTS 14 0 512000
144756576 Iftikar B Jan. 31, 2022, 4:42 p.m. OK GNU C++17 TESTS 14 0 512000
144794993 AryaShetty B Feb. 1, 2022, 4:41 a.m. OK GNU C++17 TESTS 14 0 512000
144793183 kr_vishal B Feb. 1, 2022, 4:11 a.m. OK GNU C++17 TESTS 14 15 0
144770801 sunfall B Jan. 31, 2022, 6:18 p.m. OK GNU C++17 (64) TESTS 14 0 512000
144758263 maycod23 B Jan. 31, 2022, 4:49 p.m. OK GNU C++17 (64) TESTS 14 0 512000
144757572 xhdtlsid2 B Jan. 31, 2022, 4:46 p.m. OK GNU C++17 (64) TESTS 14 0 512000
144799111 Agile_Eagle B Feb. 1, 2022, 5:56 a.m. OK GNU C++17 (64) TESTS 14 0 512000
144784801 GreenTourist B Jan. 31, 2022, 10:30 p.m. OK GNU C++17 (64) TESTS 14 0 921600
144757756 nomanhasan123 B Jan. 31, 2022, 4:47 p.m. OK GNU C++17 (64) TESTS 14 15 204800
144797913 jb_2402 B Feb. 1, 2022, 5:42 a.m. OK GNU C++17 (64) TESTS 14 15 512000
144794791 tditya_aeltia B Feb. 1, 2022, 4:38 a.m. OK GNU C++17 (64) TESTS 14 15 512000
144798536 Starscream-11813 B Feb. 1, 2022, 5:49 a.m. OK GNU C++17 (64) TESTS 14 15 512000
144798848 Win_Handsome B Feb. 1, 2022, 5:53 a.m. OK GNU C++17 (64) TESTS 14 15 512000
144764000 Rko_8001 B Jan. 31, 2022, 5:21 p.m. OK GNU C++20 (64) TESTS 14 0 512000
144783792 nebula B Jan. 31, 2022, 9:53 p.m. OK GNU C++20 (64) TESTS 14 0 512000
144767435 masudfps1 B Jan. 31, 2022, 5:48 p.m. OK GNU C++20 (64) TESTS 14 0 512000
144760834 vmsreeram B Jan. 31, 2022, 5:02 p.m. OK GNU C++20 (64) TESTS 14 0 819200
144759453 EscOutiler B Jan. 31, 2022, 4:54 p.m. OK GNU C++20 (64) TESTS 14 15 102400
144789461 gllonkxc B Feb. 1, 2022, 2:46 a.m. OK GNU C++20 (64) TESTS 14 15 204800
144794852 amit027 B Feb. 1, 2022, 4:39 a.m. OK GNU C++20 (64) TESTS 14 15 512000
144794842 happy1237 B Feb. 1, 2022, 4:38 a.m. OK GNU C++20 (64) TESTS 14 15 512000
144795268 baddog B Feb. 1, 2022, 4:48 a.m. OK GNU C++20 (64) TESTS 14 15 512000
144798114 kyon2326 B Feb. 1, 2022, 5:45 a.m. OK GNU C++20 (64) TESTS 14 15 512000
144763625 Dmohan B Jan. 31, 2022, 5:19 p.m. OK Go TESTS 14 15 1536000
144772175 glebsamsonov B Jan. 31, 2022, 6:32 p.m. OK Go TESTS 14 46 1536000
144787778 robinz62 B Feb. 1, 2022, 1:41 a.m. OK Java 11 TESTS 14 155 0
144792596 oleg01228 B Feb. 1, 2022, 4 a.m. OK Java 11 TESTS 14 171 0
144784185 vooj43 B Jan. 31, 2022, 10:07 p.m. OK Java 11 TESTS 14 171 0
144766818 gsi34 B Jan. 31, 2022, 5:42 p.m. OK Java 11 TESTS 14 187 0
144758667 SaberXpro B Jan. 31, 2022, 4:51 p.m. OK Java 11 TESTS 14 187 0
144793309 __Serendipity B Feb. 1, 2022, 4:13 a.m. OK Java 11 TESTS 14 187 0
144790476 unfixedbug B Feb. 1, 2022, 3:14 a.m. OK Java 11 TESTS 14 187 0
144779486 anjroo B Jan. 31, 2022, 8:15 p.m. OK Java 11 TESTS 14 187 0
144794694 vinayak3010 B Feb. 1, 2022, 4:36 a.m. OK Java 11 TESTS 14 217 0
144758114 Dhananjay22 B Jan. 31, 2022, 4:48 p.m. OK Java 11 TESTS 14 218 0
144789315 tushar24 B Feb. 1, 2022, 2:43 a.m. OK Java 8 TESTS 14 78 0
144774535 VishuTomar B Jan. 31, 2022, 7:01 p.m. OK Java 8 TESTS 14 93 0
144765235 Ancient_One B Jan. 31, 2022, 5:30 p.m. OK Java 8 TESTS 14 93 0
144763856 deepaksach B Jan. 31, 2022, 5:20 p.m. OK Java 8 TESTS 14 108 0
144761117 gssakash B Jan. 31, 2022, 5:03 p.m. OK Java 8 TESTS 14 108 0
144772510 NatInTheHat B Jan. 31, 2022, 6:36 p.m. OK Java 8 TESTS 14 109 0
144769202 less_ordinary B Jan. 31, 2022, 6:03 p.m. OK Java 8 TESTS 14 109 0
144795065 V3NOM9211 B Feb. 1, 2022, 4:42 a.m. OK Java 8 TESTS 14 109 0
144777035 roctes7 B Jan. 31, 2022, 7:35 p.m. OK Java 8 TESTS 14 124 0
144765589 ritu_1 B Jan. 31, 2022, 5:32 p.m. OK Java 8 TESTS 14 170 0
144768813 arvindf232 B Jan. 31, 2022, 6 p.m. OK Kotlin 1.4 TESTS 14 124 0
144781474 noisegain B Jan. 31, 2022, 8:54 p.m. OK Kotlin 1.4 TESTS 14 155 1024000
144780972 rerererere B Jan. 31, 2022, 8:43 p.m. OK Kotlin 1.5 TESTS 14 327 0
144765587 Tanish69 B Jan. 31, 2022, 5:32 p.m. OK MS C++ 2017 TESTS 14 15 512000
144789323 RealStarlight B Feb. 1, 2022, 2:43 a.m. OK MS C++ 2017 TESTS 14 15 512000
144761853 deepanshi25 B Jan. 31, 2022, 5:08 p.m. OK MS C++ 2017 TESTS 14 30 512000
144757129 coding_boi_ayush B Jan. 31, 2022, 4:44 p.m. OK MS C++ 2017 TESTS 14 30 512000
144775658 Vaibhav111 B Jan. 31, 2022, 7:16 p.m. OK MS C++ 2017 TESTS 14 30 512000
144763059 ArkZeroOne B Jan. 31, 2022, 5:15 p.m. OK MS C++ 2017 TESTS 14 30 512000
144772465 Raretet B Jan. 31, 2022, 6:36 p.m. OK MS C++ 2017 TESTS 14 31 2969600
144765051 vatsal96 B Jan. 31, 2022, 5:29 p.m. OK MS C++ 2017 TESTS 14 46 512000
144762184 DmitryVol B Jan. 31, 2022, 5:09 p.m. OK MS C++ 2017 TESTS 14 46 512000
144771806 Tangerine B Jan. 31, 2022, 6:28 p.m. OK MS C++ 2017 TESTS 14 46 512000
144784061 giovannielias9500 B Jan. 31, 2022, 10:03 p.m. OK .NET Core C# TESTS 14 108 1843200
144785809 Nidz05 B Jan. 31, 2022, 11:47 p.m. OK .NET Core C# TESTS 14 109 716800
144775871 divyateja2004 B Jan. 31, 2022, 7:19 p.m. OK Node.js TESTS 14 156 5632000
144757490 1_2_3_4_5_9 B Jan. 31, 2022, 4:46 p.m. OK PyPy 2 TESTS 14 108 3481600
144798014 majay1638 B Feb. 1, 2022, 5:43 a.m. OK PyPy 3 TESTS 14 108 4505600
144788014 majay1638 B Feb. 1, 2022, 1:52 a.m. OK PyPy 3 TESTS 14 108 4505600
144774944 Sahitya02 B Jan. 31, 2022, 7:06 p.m. OK PyPy 3 TESTS 14 140 6041600
144767799 NAVI_Perfecto B Jan. 31, 2022, 5:51 p.m. OK PyPy 3 TESTS 14 187 7270400
144757177 Austin231 B Jan. 31, 2022, 4:45 p.m. OK PyPy 3 TESTS 14 234 7782400
144788336 tranminhprvt01 B Feb. 1, 2022, 2:06 a.m. OK PyPy 3 TESTS 14 248 5939200
144760755 Tsotne22 B Jan. 31, 2022, 5:01 p.m. OK PyPy 3 TESTS 14 248 5939200
144758863 NAMGAL B Jan. 31, 2022, 4:52 p.m. OK PyPy 3 TESTS 14 248 5939200
144791735 whatshisbucket B Feb. 1, 2022, 3:43 a.m. OK PyPy 3 TESTS 14 248 6860800
144779870 abhaumik24 B Jan. 31, 2022, 8:22 p.m. OK PyPy 3 TESTS 14 249 5427200
144768631 nitish420 B Jan. 31, 2022, 5:58 p.m. OK PyPy 3-64 TESTS 14 93 9113600
144764732 epoweripi B Jan. 31, 2022, 5:26 p.m. OK PyPy 3-64 TESTS 14 109 4915200
144774560 gourav2001k B Jan. 31, 2022, 7:01 p.m. OK PyPy 3-64 TESTS 14 124 9625600
144769971 evoxtorm B Jan. 31, 2022, 6:10 p.m. OK PyPy 3-64 TESTS 14 124 10342400
144789625 DippleThree B Feb. 1, 2022, 2:51 a.m. OK PyPy 3-64 TESTS 14 218 8499200
144788013 shivam_hbtu B Feb. 1, 2022, 1:52 a.m. OK PyPy 3-64 TESTS 14 218 8499200
144788240 sharingan000 B Feb. 1, 2022, 2:02 a.m. OK PyPy 3-64 TESTS 14 218 9523200
144775660 sid0 B Jan. 31, 2022, 7:16 p.m. OK PyPy 3-64 TESTS 14 218 9523200
144795082 SubhajeetLahiri B Feb. 1, 2022, 4:42 a.m. OK PyPy 3-64 TESTS 14 233 9523200
144794255 abineth B Feb. 1, 2022, 4:29 a.m. OK PyPy 3-64 TESTS 14 233 13312000
144765261 OLOGY B Jan. 31, 2022, 5:30 p.m. OK Python 2 TESTS 14 93 2150400
144767006 wider93 B Jan. 31, 2022, 5:44 p.m. OK Python 3 TESTS 14 46 102400
144776399 edificioalto B Jan. 31, 2022, 7:26 p.m. OK Python 3 TESTS 14 46 409600
144759887 AjayChani B Jan. 31, 2022, 4:57 p.m. OK Python 3 TESTS 14 46 409600
144776624 varun077 B Jan. 31, 2022, 7:29 p.m. OK Python 3 TESTS 14 61 102400
144769191 saurabh222mishra B Jan. 31, 2022, 6:03 p.m. OK Python 3 TESTS 14 77 204800
144757038 shengyuchill B Jan. 31, 2022, 4:44 p.m. OK Python 3 TESTS 14 77 512000
144764896 gabrielrocha B Jan. 31, 2022, 5:28 p.m. OK Python 3 TESTS 14 78 1126400
144789568 M.HasnatFarooq B Feb. 1, 2022, 2:49 a.m. OK Python 3 TESTS 14 92 102400
144760953 megasrx B Jan. 31, 2022, 5:02 p.m. OK Python 3 TESTS 14 92 102400
144791719 khaliqdaad B Feb. 1, 2022, 3:43 a.m. OK Python 3 TESTS 14 92 409600
144766150 Hyrulia B Jan. 31, 2022, 5:37 p.m. OK Rust 2021 TESTS 14 93 1945600

remove filters

Back to search problems