Codeforces Round 782 (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
1659 Codeforces Round 782 (Div. 2) FINISHED False 8100 87060263 April 17, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11133 ) B Bit Flipping PROGRAMMING bitmasks constructive algorithms greedy strings

B'You are given a binary string of length n . You have exactly k moves. In one move, you must select a single bit. The state of all bits except that bit will get flipped ( 0 becomes 1 , 1 becomes 0 ). You need to output the lexicographically largest string that you can get after using all k moves. Also, output the number of times you will select each bit. If there are multiple ways to do this, you may output any of them. A binary string a is lexicographically larger than a binary string b of the same length, if and only if the following holds: The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Each test case has two lines. The first line has two integers n and k ( 1 <= q n <= q 2 cdot 10^5 ; 0 <= q k <= q 10^9 ). The second line has a binary string of length n , each character is either 0 or 1 . The sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output two lines. The first line should contain the lexicographically largest string you can obtain. The second line should contain n integers f_1, f_2, ldots, f_n , where f_i is the number of times the i -th bit is selected. The sum of all the integers must be equal to k . Here is the explanation for the first testcase. Each step shows how the binary string changes in a move. '...

Tutorials

Codeforces Round #782 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
153954734 Pendem B April 17, 2022, 9:58 p.m. OK Clang++17 Diagnostics TESTS 37 670 13824000
153930631 kakooda B April 17, 2022, 4:17 p.m. OK FPC TESTS 37 655 2457600
153971599 Sempr B April 18, 2022, 5:55 a.m. OK GNU C11 TESTS 37 779 1024000
153929818 keutoi B April 17, 2022, 4:13 p.m. OK GNU C11 TESTS 37 795 1024000
153924153 YOK B April 17, 2022, 3:52 p.m. OK GNU C11 TESTS 37 842 1024000
153961433 An_Index_in_sci. B April 18, 2022, 1:58 a.m. OK GNU C++14 TESTS 37 31 1024000
153926313 HaPpY1213 B April 17, 2022, 4 p.m. OK GNU C++14 TESTS 37 31 1024000
153926065 54181452 B April 17, 2022, 3:59 p.m. OK GNU C++14 TESTS 37 31 1024000
153968729 zorbin B April 18, 2022, 4:58 a.m. OK GNU C++14 TESTS 37 31 1024000
153969429 duoluoluo B April 18, 2022, 5:12 a.m. OK GNU C++14 TESTS 37 31 1024000
153970443 Dream4U B April 18, 2022, 5:33 a.m. OK GNU C++14 TESTS 37 31 1024000
153931750 matusinha B April 17, 2022, 4:21 p.m. OK GNU C++14 TESTS 37 31 1228800
153961735 kitsunehivern B April 18, 2022, 2:08 a.m. OK GNU C++14 TESTS 37 31 1331200
153971585 khshg B April 18, 2022, 5:55 a.m. OK GNU C++14 TESTS 37 31 1331200
153964614 saudjafar B April 18, 2022, 3:30 a.m. OK GNU C++14 TESTS 37 31 1331200
153961025 miraitowa. B April 18, 2022, 1:46 a.m. OK GNU C++17 TESTS 37 31 409600
153969909 einekleine17 B April 18, 2022, 5:21 a.m. OK GNU C++17 TESTS 37 31 716800
153945535 MasudaOmarova B April 17, 2022, 6:38 p.m. OK GNU C++17 TESTS 37 31 1024000
153955157 Zihad_28 B April 17, 2022, 10:12 p.m. OK GNU C++17 TESTS 37 31 1126400
153962041 kumar_aayush B April 18, 2022, 2:18 a.m. OK GNU C++17 TESTS 37 31 1228800
153934130 _Luci_fer B April 17, 2022, 4:31 p.m. OK GNU C++17 TESTS 37 31 1228800
153927179 canon_ B April 17, 2022, 4:03 p.m. OK GNU C++17 TESTS 37 31 1228800
153971567 Beabled B April 18, 2022, 5:55 a.m. OK GNU C++17 TESTS 37 31 1331200
153971440 MiaMicro B April 18, 2022, 5:52 a.m. OK GNU C++17 TESTS 37 31 1331200
153971278 Subhashis_CSE B April 18, 2022, 5:49 a.m. OK GNU C++17 TESTS 37 31 1331200
153935482 JustAmethyst B April 17, 2022, 4:37 p.m. OK GNU C++17 (64) TESTS 37 15 1331200
153944981 Havoc_01 B April 17, 2022, 6:28 p.m. OK GNU C++17 (64) TESTS 37 31 1024000
153926768 n0limit B April 17, 2022, 4:02 p.m. OK GNU C++17 (64) TESTS 37 31 1024000
153925388 lolicosnk B April 17, 2022, 3:57 p.m. OK GNU C++17 (64) TESTS 37 31 1024000
153945039 Havoc_01 B April 17, 2022, 6:29 p.m. OK GNU C++17 (64) TESTS 37 31 1024000
153945319 Havoc_01 B April 17, 2022, 6:34 p.m. OK GNU C++17 (64) TESTS 37 31 1024000
153935717 ankancool B April 17, 2022, 4:38 p.m. OK GNU C++17 (64) TESTS 37 31 1228800
153963615 bunny1024 B April 18, 2022, 3:03 a.m. OK GNU C++17 (64) TESTS 37 31 1331200
153970071 Amank2854 B April 18, 2022, 5:25 a.m. OK GNU C++17 (64) TESTS 37 31 1331200
153967848 mahbubhasanmht B April 18, 2022, 4:43 a.m. OK GNU C++17 (64) TESTS 37 31 1331200
153936116 nxmxnshxrmx B April 17, 2022, 4:40 p.m. OK GNU C++20 (64) TESTS 37 15 1331200
153941101 bihnehminduh B April 17, 2022, 5:31 p.m. OK GNU C++20 (64) TESTS 37 15 2150400
153930395 bharatwaj.csn B April 17, 2022, 4:16 p.m. OK GNU C++20 (64) TESTS 37 15 2150400
153935711 harshilcodes B April 17, 2022, 4:38 p.m. OK GNU C++20 (64) TESTS 37 15 3686400
153943405 CodingKnight B April 17, 2022, 6:02 p.m. OK GNU C++20 (64) TESTS 37 30 1331200
153943310 CodingKnight B April 17, 2022, 6:01 p.m. OK GNU C++20 (64) TESTS 37 30 1331200
153971584 AshutoshKJha B April 18, 2022, 5:55 a.m. OK GNU C++20 (64) TESTS 37 30 1331200
153943488 Tiagodfs B April 17, 2022, 6:04 p.m. OK GNU C++20 (64) TESTS 37 30 1331200
153966656 liuxi7086 B April 18, 2022, 4:22 a.m. OK GNU C++20 (64) TESTS 37 30 2150400
153927865 Tirthsuthar B April 17, 2022, 4:06 p.m. OK GNU C++20 (64) TESTS 37 30 4608000
153932401 koqo B April 17, 2022, 4:24 p.m. OK Go TESTS 37 77 4300800
153938277 bchang B April 17, 2022, 4:48 p.m. OK Java 11 TESTS 37 202 0
153969269 cdevadhar B April 18, 2022, 5:09 a.m. OK Java 11 TESTS 37 218 0
153961332 __Serendipity B April 18, 2022, 1:55 a.m. OK Java 11 TESTS 37 218 0
153941083 DickensTone B April 17, 2022, 5:31 p.m. OK Java 11 TESTS 37 218 0
153932091 umanggupta1975 B April 17, 2022, 4:22 p.m. OK Java 11 TESTS 37 218 0
153929384 harshman_01 B April 17, 2022, 4:12 p.m. OK Java 11 TESTS 37 218 0
153952345 AyushS_cg170 B April 17, 2022, 8:56 p.m. OK Java 11 TESTS 37 218 40550400
153947251 mayank.singh19 B April 17, 2022, 7:10 p.m. OK Java 11 TESTS 37 233 0
153946982 MrOtter B April 17, 2022, 7:04 p.m. OK Java 11 TESTS 37 233 0
153933846 anubhav44044 B April 17, 2022, 4:30 p.m. OK Java 11 TESTS 37 234 0
153940325 priyaroy3370 B April 17, 2022, 5:23 p.m. OK Java 8 TESTS 37 124 0
153965199 amit_roy B April 18, 2022, 3:46 a.m. OK Java 8 TESTS 37 124 0
153948122 BogoSortIsBest B April 17, 2022, 7:28 p.m. OK Java 8 TESTS 37 139 0
153961532 ss804 B April 18, 2022, 2:01 a.m. OK Java 8 TESTS 37 140 0
153943192 VishuTomar B April 17, 2022, 5:59 p.m. OK Java 8 TESTS 37 140 0
153941268 yunfeng B April 17, 2022, 5:33 p.m. OK Java 8 TESTS 37 140 0
153940247 MagentaCobra B April 17, 2022, 5:22 p.m. OK Java 8 TESTS 37 140 0
153937742 ND_ B April 17, 2022, 4:47 p.m. OK Java 8 TESTS 37 140 0
153936618 jonsnow7 B April 17, 2022, 4:42 p.m. OK Java 8 TESTS 37 140 0
153964048 Abdallah_Ragab00 B April 18, 2022, 3:15 a.m. OK Java 8 TESTS 37 140 0
153958651 rkmelody B April 18, 2022, 12:18 a.m. OK Kotlin 1.5 TESTS 37 280 614400
153926677 darkl0rd B April 17, 2022, 4:01 p.m. OK Kotlin 1.5 TESTS 37 280 1331200
153934437 ryanberg B April 17, 2022, 4:32 p.m. OK Kotlin 1.5 TESTS 37 343 0
153933103 Nuklinoid B April 17, 2022, 4:27 p.m. OK Mono C# TESTS 37 109 9523200
153936896 zeritonik B April 17, 2022, 4:43 p.m. OK MS C++ 2017 TESTS 37 46 204800
153932964 AIdancer B April 17, 2022, 4:26 p.m. OK MS C++ 2017 TESTS 37 78 1024000
153926648 MaksimLogic B April 17, 2022, 4:01 p.m. OK MS C++ 2017 TESTS 37 124 1228800
153930264 DmtrPpl B April 17, 2022, 4:15 p.m. OK MS C++ 2017 TESTS 37 124 1228800
153952491 bhanu_nelluri B April 17, 2022, 8:59 p.m. OK MS C++ 2017 TESTS 37 124 2150400
153934642 x-17 B April 17, 2022, 4:33 p.m. OK MS C++ 2017 TESTS 37 140 1331200
153925630 star1programist5 B April 17, 2022, 3:58 p.m. OK MS C++ 2017 TESTS 37 140 1331200
153940130 Dakericy B April 17, 2022, 5:21 p.m. OK MS C++ 2017 TESTS 37 140 2150400
153933765 suis B April 17, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 37 140 2150400
153934041 yeko0990 B April 17, 2022, 4:31 p.m. OK MS C++ 2017 TESTS 37 187 4812800
153928545 XYShaoKang B April 17, 2022, 4:08 p.m. OK Node.js TESTS 37 124 18022400
153941109 1_2_3_4_5_9 B April 17, 2022, 5:31 p.m. OK PyPy 2 TESTS 37 233 6451200
153945382 random__person B April 17, 2022, 6:35 p.m. OK PyPy 3 TESTS 37 186 18739200
153971137 legend.ary_as B April 18, 2022, 5:47 a.m. OK PyPy 3 TESTS 37 218 17203200
153949716 surstromming B April 17, 2022, 8 p.m. OK PyPy 3 TESTS 37 233 7680000
153925426 BingHa B April 17, 2022, 3:57 p.m. OK PyPy 3 TESTS 37 233 20889600
153955715 kals B April 17, 2022, 10:31 p.m. OK PyPy 3 TESTS 37 233 23244800
153924581 ____Neo____ B April 17, 2022, 3:54 p.m. OK PyPy 3 TESTS 37 296 18534400
153928076 Arcanesoul B April 17, 2022, 4:07 p.m. OK PyPy 3 TESTS 37 311 19148800
153968747 abhijeet.panihar.cse20 B April 18, 2022, 4:58 a.m. OK PyPy 3 TESTS 37 311 21196800
153924518 neko0774 B April 17, 2022, 3:54 p.m. OK PyPy 3 TESTS 37 327 15564800
153927931 _deva_ B April 17, 2022, 4:06 p.m. OK PyPy 3 TESTS 37 327 19763200
153969675 Het_Fadia B April 18, 2022, 5:17 a.m. OK PyPy 3-64 TESTS 37 156 25190400
153938027 Icedburger B April 17, 2022, 4:48 p.m. OK PyPy 3-64 TESTS 37 233 16896000
153924838 kyuremmantle B April 17, 2022, 3:55 p.m. OK PyPy 3-64 TESTS 37 249 16998400
153964390 Mustela_Erminea B April 18, 2022, 3:24 a.m. OK PyPy 3-64 TESTS 37 249 24064000
153924829 cofonewbie B April 17, 2022, 3:55 p.m. OK PyPy 3-64 TESTS 37 249 27955200
153929526 mina2000gt B April 17, 2022, 4:12 p.m. OK PyPy 3-64 TESTS 37 264 20992000
153928951 unknownSolver B April 17, 2022, 4:10 p.m. OK PyPy 3-64 TESTS 37 264 32563200
153930980 k039 B April 17, 2022, 4:18 p.m. OK PyPy 3-64 TESTS 37 280 18841600
153950804 EnDeRBeaT B April 17, 2022, 8:24 p.m. OK PyPy 3-64 TESTS 37 280 26521600
153965488 sjNxksbzj B April 18, 2022, 3:53 a.m. OK PyPy 3-64 TESTS 37 295 35430400
153927670 ScholarlyChives B April 17, 2022, 4:05 p.m. OK Python 3 TESTS 37 202 9318400
153934158 ifte104 B April 17, 2022, 4:31 p.m. OK Python 3 TESTS 37 202 10035200
153932759 i_emerge16 B April 17, 2022, 4:25 p.m. OK Python 3 TESTS 37 202 13619200
153925045 HCISY B April 17, 2022, 3:55 p.m. OK Python 3 TESTS 37 218 10342400
153929809 laoda B April 17, 2022, 4:13 p.m. OK Python 3 TESTS 37 264 10854400
153925576 Keynman B April 17, 2022, 3:57 p.m. OK Python 3 TESTS 37 296 10035200
153942963 NS3081992 B April 17, 2022, 5:55 p.m. OK Python 3 TESTS 37 296 10444800
153940320 sziiza B April 17, 2022, 5:23 p.m. OK Python 3 TESTS 37 327 2150400
153953480 nkcrg060497 B April 17, 2022, 9:23 p.m. OK Python 3 TESTS 37 374 2969600
153927331 mcorr B April 17, 2022, 4:04 p.m. OK Python 3 TESTS 37 374 10956800
153935590 RustyInCP B April 17, 2022, 4:37 p.m. OK Rust 2021 TESTS 37 31 1331200
153928970 takezawa B April 17, 2022, 4:10 p.m. OK Rust 2021 TESTS 37 31 3481600
153926753 Bisspector B April 17, 2022, 4:02 p.m. OK Rust 2021 TESTS 37 93 10854400

remove filters

Back to search problems