Codeforces Round 944 (Div. 4)

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
1971 Codeforces Round 944 (Div. 4) FINISHED False 8100 61053923 May 10, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 30478 ) D Binary Cut PROGRAMMING dp greedy implementation sortings strings 1100

You are given a binary string ^{ dagger} . Please find the minimum number of pieces you need to cut it into, so that the resulting pieces can be rearranged into a sorted binary string. Note that: ^{ dagger} A binary string is a string consisting of characters texttt{0} and texttt{1} . A sorted binary string is a binary string such that all characters texttt{0} come before all characters texttt{1} . The first line contains a single integer t ( 1 <= q t <= q 500 ) -- the number of test cases. The only line of each test case contains a single string s ( 1 <= q |s| <= q 500 ) consisting of characters texttt{0} and texttt{1} , where |s| denotes the length of the string s . For each test case, output a single integer -- the minimum number of pieces needed to be able to rearrange the string into a sorted binary string. The first test case is pictured in the statement. It can be proven that you can't use fewer than 3 pieces. In the second and third test cases, the binary string is already sorted, so only 1 piece is needed. In the fourth test case, you need to make a single cut between the two characters and rearrange them to make the string texttt{01} .

Tutorials

Codeforces Round 944 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
263449380 Bad_Kpot D May 31, 2024, 10:11 a.m. OK C# 10 TESTS 7 218 3788800 1100
263703969 gardenbetweens D June 2, 2024, 5:45 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263701064 farcat576 D June 2, 2024, 5:07 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263672048 kritic1329 D June 1, 2024, 6:49 p.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263625316 Weekoder D June 1, 2024, 11:58 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263613245 ngominhkhoa2006 D June 1, 2024, 10:28 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263413904 xxxtentacionreal D May 31, 2024, 5:20 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263218069 sumitst05_ D May 30, 2024, 9:44 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263107087 YCKC_LCJ D May 29, 2024, 7:55 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263091288 rudrakshsattabhayya D May 29, 2024, 5:46 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263090853 rudrakshsattabhayya D May 29, 2024, 5:40 a.m. OK C++14 (GCC 6-32) TESTS 7 46 0 1100
263669573 vibhu7s D June 1, 2024, 6:23 p.m. OK C++17 (GCC 7-32) TESTS 7 31 0 1100
263233592 vjudge.7 D May 30, 2024, 11:53 a.m. OK C++17 (GCC 7-32) TESTS 7 31 0 1100
262281191 Average_Guy_01 D May 23, 2024, 3:40 p.m. OK C++17 (GCC 7-32) TESTS 7 31 0 1100
263692925 david20132 D June 2, 2024, 2:42 a.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263691853 mokshit_123 D June 2, 2024, 2:19 a.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263687690 random._.int D June 2, 2024, 12:20 a.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263687485 md_jakir D June 2, 2024, 12:12 a.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263680515 mkrm D June 1, 2024, 8:53 p.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263677107 binary_monk D June 1, 2024, 7:56 p.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263671502 salma_amr17 D June 1, 2024, 6:43 p.m. OK C++17 (GCC 7-32) TESTS 7 46 0 1100
263000124 _de1_ D May 28, 2024, 11:10 a.m. OK C++20 (GCC 13-64) TESTS 7 31 0 1100
263680392 ShadowRainger D June 1, 2024, 8:51 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263678545 Chinosaw EHABO D June 1, 2024, 8:19 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263665739 MosaabGKA D June 1, 2024, 5:48 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263653648 deepanshusau D June 1, 2024, 4:04 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263646892 Russian_Chessist D June 1, 2024, 3:07 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263610836 Weekoder D June 1, 2024, 10:07 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263574038 amisha D June 1, 2024, 4:39 a.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263550826 kartiko2 D May 31, 2024, 9:06 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263539298 Yurry D May 31, 2024, 6:26 p.m. OK C++20 (GCC 13-64) TESTS 7 46 0 1100
263632235 Gladi_7 D June 1, 2024, 12:59 p.m. OK GNU C11 TESTS 7 46 102400 1100
262830943 deanjon_roy D May 27, 2024, 5:39 a.m. OK GNU C11 TESTS 7 46 102400 1100
262765866 At_07 D May 26, 2024, 3:54 p.m. OK GNU C11 TESTS 7 46 307200 1100
262616840 7emerka D May 25, 2024, 6:45 p.m. OK GNU C11 TESTS 7 61 102400 1100
262192757 percivalKyo D May 22, 2024, 8:24 p.m. OK GNU C11 TESTS 7 61 102400 1100
263009107 medara D May 28, 2024, 12:22 p.m. OK GNU C11 TESTS 7 62 0 1100
263593895 immortalfox D June 1, 2024, 7:47 a.m. OK Go TESTS 7 46 307200 1100
263606763 YeWeiQiang D June 1, 2024, 9:32 a.m. OK Go TESTS 7 234 307200 1100
263196270 epicplayer12346 D May 30, 2024, 3:27 a.m. OK Java 21 TESTS 7 234 1433600 1100
262314414 mangos194 D May 23, 2024, 9:41 p.m. OK Java 21 TESTS 7 249 409600 1100
262625771 personalfebus D May 25, 2024, 9:05 p.m. OK Java 21 TESTS 7 249 716800 1100
262889050 Mg718 D May 27, 2024, 1:42 p.m. OK Java 21 TESTS 7 249 819200 1100
263705163 srivastavaprakhar7727 D June 2, 2024, 5:58 a.m. OK Java 21 TESTS 7 265 102400 1100
263245604 vjudge.4 D May 30, 2024, 12:16 p.m. OK Java 21 TESTS 7 265 409600 1100
262707448 federicog1 D May 26, 2024, 1:05 p.m. OK Java 21 TESTS 7 265 921600 1100
262274408 anupam_das_2011 D May 23, 2024, 2:40 p.m. OK Java 21 TESTS 7 280 307200 1100
262949008 Morker D May 28, 2024, 2:57 a.m. OK Java 21 TESTS 7 280 819200 1100
262242658 Rituraj379 D May 23, 2024, 10:45 a.m. OK Java 21 TESTS 7 280 819200 1100
263574640 lavender_me D June 1, 2024, 4:46 a.m. OK Java 8 TESTS 7 124 0 1100
262852854 Ovetsar_ilish D May 27, 2024, 8:49 a.m. OK Java 8 TESTS 7 139 0 1100
263570623 thrasher D June 1, 2024, 3:57 a.m. OK Java 8 TESTS 7 140 0 1100
262615785 y_a_s D May 25, 2024, 6:17 p.m. OK Java 8 TESTS 7 156 0 1100
263622555 aparna_nagpal D June 1, 2024, 11:37 a.m. OK Java 8 TESTS 7 171 0 1100
263381079 abhi_5829 D May 30, 2024, 7:31 p.m. OK Java 8 TESTS 7 171 0 1100
263098109 klu_2100031963 D May 29, 2024, 6:48 a.m. OK Java 8 TESTS 7 171 0 1100
262966052 Dev3161 D May 28, 2024, 6:15 a.m. OK Java 8 TESTS 7 171 0 1100
262906078 vikashkumarukg977 D May 27, 2024, 3:56 p.m. OK Java 8 TESTS 7 171 0 1100
262934812 arpit.mishra D May 27, 2024, 9:21 p.m. OK Java 8 TESTS 7 186 0 1100
262443994 housni D May 24, 2024, 11:43 p.m. OK Kotlin 1.7 TESTS 7 327 819200 1100
262174294 Krantzy D May 22, 2024, 5:08 p.m. OK Kotlin 1.9 TESTS 7 218 0 1100
262173364 Krantzy D May 22, 2024, 5 p.m. OK Kotlin 1.9 TESTS 7 233 1843200 1100
262487789 klu-2100030642 D May 25, 2024, 9:22 a.m. OK PyPy 3 TESTS 7 108 716800 1100
263159607 Ashutosh352 D May 29, 2024, 3 p.m. OK PyPy 3 TESTS 7 109 2662400 1100
263162306 ImWasil D May 29, 2024, 3:26 p.m. OK PyPy 3 TESTS 7 140 2764800 1100
262173211 __empty__ D May 22, 2024, 4:59 p.m. OK PyPy 3-64 TESTS 7 78 307200 1100
263653104 mohammadolimat D June 1, 2024, 3:59 p.m. OK PyPy 3-64 TESTS 7 92 1536000 1100
262862007 ryoiki_senpai D May 27, 2024, 10:08 a.m. OK PyPy 3-64 TESTS 7 93 1433600 1100
262406514 klindyuk D May 24, 2024, 3:26 p.m. OK PyPy 3-64 TESTS 7 93 1433600 1100
262558058 MistaFlash D May 25, 2024, 3:16 p.m. OK PyPy 3-64 TESTS 7 93 1638400 1100
263190745 TadeIteso D May 29, 2024, 11:27 p.m. OK PyPy 3-64 TESTS 7 93 1843200 1100
263680066 KEMH D June 1, 2024, 8:43 p.m. OK PyPy 3-64 TESTS 7 93 2252800 1100
262942296 Retereum D May 28, 2024, 12:41 a.m. OK PyPy 3-64 TESTS 7 93 2457600 1100
263380134 DaniilBarmin D May 30, 2024, 7:18 p.m. OK PyPy 3-64 TESTS 7 93 2969600 1100
262441147 NitroSpear D May 24, 2024, 10:15 p.m. OK PyPy 3-64 TESTS 7 93 3481600 1100
262822014 klu2100031976 D May 27, 2024, 4:25 a.m. OK Python 3 TESTS 7 61 0 1100
262414388 jihed007 D May 24, 2024, 4:36 p.m. OK Python 3 TESTS 7 61 0 1100
263608231 bakhram65 D June 1, 2024, 9:45 a.m. OK Python 3 TESTS 7 62 0 1100
263073475 darkcodeemohammed D May 29, 2024, 12:41 a.m. OK Python 3 TESTS 7 62 0 1100
262352208 2210080018 D May 24, 2024, 8:01 a.m. OK Python 3 TESTS 7 62 0 1100
263175258 amar31661 D May 29, 2024, 6:17 p.m. OK Python 3 TESTS 7 77 0 1100
263001344 Saumya_coder D May 28, 2024, 11:20 a.m. OK Python 3 TESTS 7 77 0 1100
262469376 DenialC D May 25, 2024, 6:37 a.m. OK Python 3 TESTS 7 77 0 1100
262417031 MubassirSadik D May 24, 2024, 5:01 p.m. OK Python 3 TESTS 7 77 0 1100
263595261 cheking D June 1, 2024, 7:58 a.m. OK Python 3 TESTS 7 92 0 1100
262631554 SnowballSH D May 25, 2024, 11:41 p.m. OK Rust 2021 TESTS 7 46 0 1100

remove filters

Back to search problems