Codeforces Round 598 (Div. 3)

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
1256 Codeforces Round 598 (Div. 3) FINISHED False 7200 158949899 Nov. 4, 2019, 1:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12142 ) D Binary String Minimizing PROGRAMMING greedy 1500

B"You are given a binary string of length n (i. xe2 x80 x89e. a string consisting of n characters '0' and '1'). In one move you can swap two adjacent characters of the string. What is the lexicographically minimum possible string you can obtain from the given one if you can perform no more than k moves? It is possible that you do not perform any moves at all. Note that you can swap the same pair of adjacent characters with indices i and i+1 arbitrary (possibly, zero) number of times. Each such swap is considered a separate move. You have to answer q independent test cases. The first line of the input contains one integer q ( 1 <= q <= 10^4 ) -- the number of test cases. The first line of the test case contains two integers n and k ( 1 <= n <= 10^6, 1 <= k <= n^2 ) -- the length of the string and the number of moves you can perform. The second line of the test case contains one string consisting of n characters '0' and '1'. It is guaranteed that the sum of n over all test cases does not exceed 10^6 ( sum n <= 10^6 ). For each test case, print the answer on it: the lexicographically minimum possible string of length n you can obtain from the given one if you can perform no more than k moves. In the first example, you can change the string as follows: 1 underline{10}11010 rightarrow underline{10}111010 rightarrow 0111 underline{10}10 rightarrow 011 underline{10}110 rightarrow 01 underline{10}1110 rightarrow 01011110 . In the third example, there are enough operations to make the string sorted. "...

Tutorials

Codeforces Round #598 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
64701055 gdoritos D Nov. 11, 2019, 2:50 p.m. OK Clang++17 Diagnostics TESTS 28 296 102400 1500
67286509 abcd227 D Dec. 20, 2019, 2:25 p.m. OK GNU C11 TESTS 28 31 1024000 1500
64540670 jschr D Nov. 8, 2019, 6:32 p.m. OK GNU C11 TESTS 28 46 5017600 1500
65276994 blak_dragon D Nov. 18, 2019, 2:17 a.m. OK GNU C11 TESTS 28 93 1024000 1500
65314071 hpl D Nov. 18, 2019, 4:30 p.m. OK GNU C11 TESTS 28 93 1024000 1500
65801004 ifsanjry D Nov. 27, 2019, 7:26 a.m. OK GNU C11 TESTS 28 108 1024000 1500
65949957 keshav.maverick D Nov. 29, 2019, 10:24 a.m. OK GNU C11 TESTS 28 108 1024000 1500
65605308 zxcvbnm04987 D Nov. 23, 2019, 8:19 p.m. OK GNU C11 TESTS 28 109 1024000 1500
64483991 torque_459 D Nov. 7, 2019, 5:01 p.m. OK GNU C11 TESTS 28 109 1024000 1500
64372598 DevJewel D Nov. 6, 2019, 2:49 p.m. OK GNU C11 TESTS 28 109 1024000 1500
65605489 zxcvbnm04987 D Nov. 23, 2019, 8:25 p.m. OK GNU C11 TESTS 28 124 1024000 1500
64587386 luogu_bot1 D Nov. 9, 2019, 1:43 p.m. OK GNU C++11 TESTS 28 31 819200 1500
65297639 vjudge2 D Nov. 18, 2019, 12:07 p.m. OK GNU C++11 TESTS 28 31 1024000 1500
65297716 vjudge2 D Nov. 18, 2019, 12:08 p.m. OK GNU C++11 TESTS 28 31 1024000 1500
66534861 ddh D Dec. 9, 2019, 9:12 a.m. OK GNU C++11 TESTS 28 31 2048000 1500
65430662 Tak3n D Nov. 20, 2019, 11:58 a.m. OK GNU C++11 TESTS 28 31 5017600 1500
66432044 yurzhang D Dec. 7, 2019, 3:43 a.m. OK GNU C++11 TESTS 28 46 819200 1500
65572334 xiximo1204 D Nov. 23, 2019, 8:16 a.m. OK GNU C++11 TESTS 28 46 819200 1500
68911146 vjudge1 D Jan. 16, 2020, 7:41 a.m. OK GNU C++11 TESTS 28 46 819200 1500
68010648 liv23333 D Dec. 31, 2019, 3:35 p.m. OK GNU C++11 TESTS 28 46 819200 1500
66569697 luogu_bot4 D Dec. 10, 2019, 3:12 a.m. OK GNU C++11 TESTS 28 46 819200 1500
65329520 six-lyk-six D Nov. 19, 2019, 4:55 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
65349582 dump_fly D Nov. 19, 2019, 1:50 p.m. OK GNU C++14 TESTS 28 46 1024000 1500
65618168 vjudge3 D Nov. 24, 2019, 5:02 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
66010476 vjudge1 D Nov. 30, 2019, 2:08 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
68069000 dysnomia D Jan. 2, 2020, 9:20 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
66010499 vjudge1 D Nov. 30, 2019, 2:09 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
66103944 hhx729 D Dec. 1, 2019, 8:40 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
65260011 naim6246 D Nov. 17, 2019, 2:44 p.m. OK GNU C++14 TESTS 28 46 1024000 1500
65029353 mightyslavek D Nov. 15, 2019, 9:12 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
65022410 XOR-star D Nov. 15, 2019, 5:55 a.m. OK GNU C++14 TESTS 28 46 1024000 1500
65816294 ATLTA D Nov. 27, 2019, 9:34 a.m. OK GNU C++17 TESTS 28 46 1024000 1500
69277659 Hydrogen5 D Jan. 22, 2020, 3:40 a.m. OK GNU C++17 TESTS 28 46 1024000 1500
68749516 bigbroX D Jan. 14, 2020, 6:09 a.m. OK GNU C++17 TESTS 28 46 1024000 1500
68350638 vjudge3 D Jan. 7, 2020, 9:39 a.m. OK GNU C++17 TESTS 28 46 1024000 1500
66556254 qgjz D Dec. 9, 2019, 4:56 p.m. OK GNU C++17 TESTS 28 46 1024000 1500
66230844 ADORED D Dec. 3, 2019, 2:20 p.m. OK GNU C++17 TESTS 28 46 1024000 1500
66211921 njtech1401170211 D Dec. 3, 2019, 7:11 a.m. OK GNU C++17 TESTS 28 46 1024000 1500
65950031 keshav.maverick D Nov. 29, 2019, 10:26 a.m. OK GNU C++17 TESTS 28 46 1024000 1500
65827262 SSSyu D Nov. 27, 2019, 1:01 p.m. OK GNU C++17 TESTS 28 46 1024000 1500
65607236 ipaljak D Nov. 23, 2019, 9:37 p.m. OK GNU C++17 TESTS 28 46 1024000 1500
64723017 qianhailong D Nov. 12, 2019, 5:06 a.m. OK Go TESTS 28 77 4608000 1500
65505899 stefan.sakalik D Nov. 21, 2019, 10:29 p.m. OK Go TESTS 28 78 5324800 1500
69276988 amarjeetanand D Jan. 22, 2020, 3:04 a.m. OK Go TESTS 28 92 4505600 1500
69276882 amarjeetanand D Jan. 22, 2020, 2:58 a.m. OK Go TESTS 28 92 4505600 1500
69276869 amarjeetanand D Jan. 22, 2020, 2:58 a.m. OK Go TESTS 28 93 4608000 1500
69276860 amarjeetanand D Jan. 22, 2020, 2:57 a.m. OK Go TESTS 28 93 4608000 1500
67762055 sighduck D Dec. 27, 2019, 11:32 p.m. OK Go TESTS 28 109 18432000 1500
64312094 maguroguma D Nov. 5, 2019, 1:03 p.m. OK Go TESTS 28 124 35737600 1500
67975684 machhra D Dec. 30, 2019, 4:49 p.m. OK Java 11 TESTS 28 218 0 1500
65401974 davisrollman D Nov. 19, 2019, 11:17 p.m. OK Java 11 TESTS 28 218 0 1500
68044684 MaxHeap D Jan. 1, 2020, 3:55 p.m. OK Java 11 TESTS 28 234 0 1500
64869682 Maves D Nov. 14, 2019, 7:41 a.m. OK Java 11 TESTS 28 296 102400 1500
64487469 ZeroAmbition D Nov. 7, 2019, 6:22 p.m. OK Java 11 TESTS 28 358 512000 1500
65899924 arpunagar D Nov. 28, 2019, 8:14 a.m. OK Java 11 TESTS 28 405 10956800 1500
66655788 TheSawan D Dec. 11, 2019, 10:35 p.m. OK Java 11 TESTS 28 405 57446400 1500
64607576 theBiker D Nov. 9, 2019, 9:47 p.m. OK Java 11 TESTS 28 420 47308800 1500
67774218 kukreja-vlk D Dec. 28, 2019, 8:17 a.m. OK Java 11 TESTS 28 451 67072000 1500
66260854 kiberKotleta2009 D Dec. 4, 2019, 8:19 a.m. OK Java 11 TESTS 28 499 86732800 1500
64320555 coeuvre D Nov. 5, 2019, 3:30 p.m. OK Java 8 TESTS 28 140 0 1500
66630427 O_E D Dec. 11, 2019, 10:57 a.m. OK Java 8 TESTS 28 140 0 1500
66604302 Ahmad D Dec. 10, 2019, 5:48 p.m. OK Java 8 TESTS 28 140 0 1500
65702586 MahmoudJobeel D Nov. 25, 2019, 11:21 a.m. OK Java 8 TESTS 28 140 0 1500
64494740 bluesky111 D Nov. 7, 2019, 10:31 p.m. OK Java 8 TESTS 28 140 0 1500
64355547 htvu D Nov. 6, 2019, 10:04 a.m. OK Java 8 TESTS 28 140 0 1500
64320641 lollipop1dino D Nov. 5, 2019, 3:32 p.m. OK Java 8 TESTS 28 140 0 1500
64313124 sarthakmanna D Nov. 5, 2019, 1:20 p.m. OK Java 8 TESTS 28 140 0 1500
64493935 eztso D Nov. 7, 2019, 9:51 p.m. OK Java 8 TESTS 28 140 2969600 1500
65545582 YazanAssaf D Nov. 22, 2019, 5:02 p.m. OK Java 8 TESTS 28 155 0 1500
65940555 cmplx-xyttmt D Nov. 29, 2019, 5:56 a.m. OK Kotlin TESTS 28 327 2969600 1500
65186827 sashamc D Nov. 16, 2019, 3:18 p.m. OK Kotlin TESTS 28 795 117657600 1500
65602647 m1_k3 D Nov. 23, 2019, 6:51 p.m. OK Mono C# TESTS 28 124 7884800 1500
65460367 tycyd D Nov. 21, 2019, 1:22 a.m. OK Mono C# TESTS 28 124 21606400 1500
64890417 hloya D Nov. 14, 2019, 2:32 p.m. OK Mono C# TESTS 28 155 18534400 1500
66168839 treasuryonly D Dec. 2, 2019, 9:11 a.m. OK Mono C# TESTS 28 155 35225600 1500
65229049 DM7PvTyc D Nov. 17, 2019, 3:47 a.m. OK Mono C# TESTS 28 187 23961600 1500
64862672 cs_office D Nov. 14, 2019, 4:15 a.m. OK Mono C# TESTS 28 249 23756800 1500
66401698 vjudge3 D Dec. 6, 2019, 12:29 p.m. OK MS C++ TESTS 28 46 1024000 1500
66400252 vjudge1 D Dec. 6, 2019, 12:04 p.m. OK MS C++ TESTS 28 46 1024000 1500
66214450 vjudge1 D Dec. 3, 2019, 8:19 a.m. OK MS C++ TESTS 28 46 1024000 1500
66184228 vjudge5 D Dec. 2, 2019, 1:52 p.m. OK MS C++ TESTS 28 46 1024000 1500
66404263 vjudge1 D Dec. 6, 2019, 1:13 p.m. OK MS C++ TESTS 28 46 1024000 1500
66405541 vjudge3 D Dec. 6, 2019, 1:34 p.m. OK MS C++ TESTS 28 46 1024000 1500
66430816 vjudge4 D Dec. 7, 2019, 2:42 a.m. OK MS C++ TESTS 28 46 1024000 1500
66437157 vjudge3 D Dec. 7, 2019, 6:39 a.m. OK MS C++ TESTS 28 46 1024000 1500
68906666 vjudge4 D Jan. 16, 2020, 6:55 a.m. OK MS C++ TESTS 28 46 1024000 1500
68902938 vjudge4 D Jan. 16, 2020, 6:22 a.m. OK MS C++ TESTS 28 46 1024000 1500
64740930 UAV D Nov. 12, 2019, 11:58 a.m. OK MS C++ 2017 TESTS 28 46 1024000 1500
66398630 vjudge3 D Dec. 6, 2019, 11:37 a.m. OK MS C++ 2017 TESTS 28 46 1024000 1500
65292342 vjudge2 D Nov. 18, 2019, 10:15 a.m. OK MS C++ 2017 TESTS 28 46 1024000 1500
64560653 vjudge5 D Nov. 9, 2019, 5:54 a.m. OK MS C++ 2017 TESTS 28 46 1024000 1500
64553423 Traveller_ D Nov. 9, 2019, 1:45 a.m. OK MS C++ 2017 TESTS 28 46 1024000 1500
64443445 RONGER D Nov. 7, 2019, 5:31 a.m. OK MS C++ 2017 TESTS 28 46 2048000 1500
66481437 YoshinariYoh D Dec. 8, 2019, 3:01 a.m. OK MS C++ 2017 TESTS 28 46 10035200 1500
64443500 RONGER D Nov. 7, 2019, 5:33 a.m. OK MS C++ 2017 TESTS 28 62 1024000 1500
64316466 YamagenSakam D Nov. 5, 2019, 2:16 p.m. OK MS C++ 2017 TESTS 28 62 2867200 1500
64592703 Nadeev D Nov. 9, 2019, 3:22 p.m. OK MS C++ 2017 TESTS 28 62 4915200 1500
66474304 TitanRoyal D Dec. 7, 2019, 7:51 p.m. OK Node.js TESTS 28 483 34611200 1500
65295306 yumtam D Nov. 18, 2019, 11:15 a.m. OK PyPy 2 TESTS 28 265 6860800 1500
66654400 ContextLogic D Dec. 11, 2019, 9:14 p.m. OK PyPy 2 TESTS 28 420 30003200 1500
64342518 NotMuchToLearn D Nov. 6, 2019, 3:55 a.m. OK PyPy 2 TESTS 28 436 32563200 1500
65509385 le_michael D Nov. 22, 2019, 2:22 a.m. OK PyPy 2 TESTS 28 530 111411200 1500
65998104 arp106 D Nov. 29, 2019, 6:11 p.m. OK PyPy 3 TESTS 28 373 39116800 1500
64343042 HarendraSingh22 D Nov. 6, 2019, 4:20 a.m. OK PyPy 3 TESTS 28 404 35942400 1500
64319782 vaibhavsarda D Nov. 5, 2019, 3:15 p.m. OK PyPy 3 TESTS 28 404 36556800 1500
64592259 yfo D Nov. 9, 2019, 3:11 p.m. OK PyPy 3 TESTS 28 420 32051200 1500
65110378 Leendertz D Nov. 15, 2019, 9:57 p.m. OK PyPy 3 TESTS 28 421 56627200 1500
68134642 Mr.Inconsistent D Jan. 3, 2020, 6:20 p.m. OK PyPy 3 TESTS 28 467 44851200 1500
68130067 mr.inconsitent D Jan. 3, 2020, 4:41 p.m. OK PyPy 3 TESTS 28 468 44851200 1500
67189299 kevinwinatamichael D Dec. 19, 2019, 6:23 a.m. OK PyPy 3 TESTS 28 483 29900800 1500
65318055 sanjailal4 D Nov. 18, 2019, 6:19 p.m. OK PyPy 3 TESTS 28 499 35737600 1500
64320299 saglam.muzaffer D Nov. 5, 2019, 3:26 p.m. OK PyPy 3 TESTS 28 514 15564800 1500
64372528 Mike10 D Nov. 6, 2019, 2:47 p.m. OK Python 2 TESTS 28 483 20992000 1500
67735298 soumyasarkar1998 D Dec. 27, 2019, 4 p.m. OK Python 2 TESTS 28 732 4505600 1500
64520824 Annvv D Nov. 8, 2019, 12:15 p.m. OK Python 3 TESTS 28 451 4608000 1500
64767706 evinpinarornek D Nov. 12, 2019, 9:41 p.m. OK Python 3 TESTS 28 468 10240000 1500
64362047 CaC03 D Nov. 6, 2019, 11:59 a.m. OK Python 3 TESTS 28 499 7884800 1500
64320181 ghostpy D Nov. 5, 2019, 3:23 p.m. OK Python 3 TESTS 28 529 8601600 1500
66632809 drogon_nest D Dec. 11, 2019, 11:49 a.m. OK Python 3 TESTS 28 576 4608000 1500
64331206 LintuStorm D Nov. 5, 2019, 7:25 p.m. OK Python 3 TESTS 28 577 7577600 1500
65705277 parvezaalam786 D Nov. 25, 2019, 12:20 p.m. OK Python 3 TESTS 28 638 5017600 1500
64661231 blinkRS D Nov. 10, 2019, 9:03 p.m. OK Python 3 TESTS 28 639 4608000 1500
65645198 _.zoro. D Nov. 24, 2019, 9:20 a.m. OK Python 3 TESTS 28 639 5017600 1500
64434697 vitoshacademy D Nov. 7, 2019, 12:22 a.m. OK Python 3 TESTS 28 654 12083200 1500
64665448 ten- D Nov. 11, 2019, 1:40 a.m. OK Rust TESTS 28 77 12697600 1500
65659143 ichyo D Nov. 24, 2019, 11:40 a.m. OK Rust TESTS 28 78 10956800 1500
64665718 ten- D Nov. 11, 2019, 1:57 a.m. OK Rust TESTS 28 78 12697600 1500
64665657 ten- D Nov. 11, 2019, 1:53 a.m. OK Rust TESTS 28 78 12697600 1500
64597498 kobae964 D Nov. 9, 2019, 5:20 p.m. OK Rust TESTS 28 109 12492800 1500
65907650 yuya178 D Nov. 28, 2019, 11:39 a.m. OK Rust TESTS 28 295 14950400 1500
65154234 techaddict D Nov. 16, 2019, 8:42 a.m. OK Scala TESTS 28 607 2048000 1500

remove filters

Back to search problems