Codeforces Round 822 (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
1734 Codeforces Round 822 (Div. 2) FINISHED False 7200 73331663 Sept. 23, 2022, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19802 ) C Removing Smallest Multiples PROGRAMMING greedy math

B"You are given a set S , which contains the first n positive integers: 1, 2, ldots, n . You can perform the following operation on S any number of times (possibly zero): You are given a set T , which is a subset of S . Find the minimum possible total cost of operations such that S would be transformed into T . We can show that such a transformation is always possible. The first line of the input contains a single integer t ( 1 <= t <= 10 ,000 ) -- the number of test cases. The description of the test cases follows. The first line contains a single positive integer n ( 1 <= n <= 10^6 ). The second line of each test case contains a binary string of length n , describing the set T . The i -th character of the string is '1' if and only if i is an element of T , and '0' otherwise. It is guaranteed that the sum of n over all test cases does not exceed 10^6 . For each test case, output one non-negative integer -- the minimum possible total cost of operations such that S would be transformed into T . In the first test case, we shall not perform any operations as S is already equal to T , which is the set {1, 2, 3, 4, 5, 6 } . In the second test case, initially, S = {1, 2, 3, 4, 5, 6, 7 } , and T = {1, 2, 4, 7 } . We shall perform the following operations: The total cost is 3+3+5 = 11 . It can be shown that this is the smallest cost possible. In the third test case, initially, S = {1, 2, 3, 4 } and T = { } (empty set). We shall perform 4 operations of k=1 to delete 1 , 2 , 3 , and 4 . In the fourth test case, initially, S = {1, 2, 3, 4 } and T = {3 } . We shall perform two operations with k=1 to delete 1 and 2 , then perform one operation with k=2 to delete 4 . "...

Tutorials

Codeforces Round #822 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
173225344 doublethinker C Sept. 23, 2022, 2:40 p.m. OK C# 10 TESTS 29 108 4915200
173216119 anov44 C Sept. 23, 2022, 1:49 p.m. OK C# 10 TESTS 29 140 24678400
173252464 AnnaElli C Sept. 23, 2022, 6:43 p.m. OK C# 10 TESTS 29 187 7577600
173220754 FatalityNT C Sept. 23, 2022, 2:01 p.m. OK C# 8 TESTS 29 186 8294400
173263689 vjudge1 C Sept. 24, 2022, 3:18 a.m. OK Clang++17 Diagnostics TESTS 29 295 4403200
173229677 Algor_ C Sept. 23, 2022, 3:05 p.m. OK Clang++20 Diagnostics TESTS 29 701 36761600
173229822 zxilly C Sept. 23, 2022, 3:06 p.m. OK Clang++20 Diagnostics TESTS 29 982 41779200
173229105 Algor_ C Sept. 23, 2022, 3:01 p.m. OK Clang++20 Diagnostics TESTS 29 1122 41779200
173228333 Algor_ C Sept. 23, 2022, 2:56 p.m. OK Clang++20 Diagnostics TESTS 29 1699 43110400
173228094 Amarantos475 C Sept. 23, 2022, 2:54 p.m. OK Clang++20 Diagnostics TESTS 29 1808 25292800
173226169 Amarantos475 C Sept. 23, 2022, 2:43 p.m. OK Clang++20 Diagnostics TESTS 29 1808 25292800
173225943 Amarantos475 C Sept. 23, 2022, 2:42 p.m. OK Clang++20 Diagnostics TESTS 29 1824 5529600
173228163 Algor_ C Sept. 23, 2022, 2:54 p.m. OK Clang++20 Diagnostics TESTS 29 1886 36761600
173226942 zxilly C Sept. 23, 2022, 2:47 p.m. OK Clang++20 Diagnostics TESTS 29 1886 36761600
173253913 ssarwarbd C Sept. 23, 2022, 7 p.m. OK GNU C11 TESTS 29 62 1945600
173244460 ssarwarbd C Sept. 23, 2022, 5:16 p.m. OK GNU C11 TESTS 29 93 2048000
173263504 Sz_zUwu C Sept. 24, 2022, 3:15 a.m. OK GNU C++14 TESTS 29 31 1024000
173246003 Li_Xiang C Sept. 23, 2022, 5:34 p.m. OK GNU C++14 TESTS 29 31 1024000
173243919 yxy2222 C Sept. 23, 2022, 5:10 p.m. OK GNU C++14 TESTS 29 31 1024000
173264609 pengym C Sept. 24, 2022, 3:28 a.m. OK GNU C++14 TESTS 29 31 1024000
173273606 peter112358 C Sept. 24, 2022, 5:35 a.m. OK GNU C++14 TESTS 29 31 1024000
173233263 tcm C Sept. 23, 2022, 3:33 p.m. OK GNU C++14 TESTS 29 31 2048000
173230552 Taitup C Sept. 23, 2022, 3:11 p.m. OK GNU C++14 TESTS 29 31 2048000
173226620 glotm C Sept. 23, 2022, 2:45 p.m. OK GNU C++14 TESTS 29 31 2048000
173244073 KhaledFarhat C Sept. 23, 2022, 5:12 p.m. OK GNU C++14 TESTS 29 31 2048000
173240614 ReimuHakurei C Sept. 23, 2022, 4:38 p.m. OK GNU C++14 TESTS 29 31 2048000
173239193 Perl32 C Sept. 23, 2022, 4:25 p.m. OK GNU C++17 TESTS 29 31 1024000
173234138 Yzm007 C Sept. 23, 2022, 3:39 p.m. OK GNU C++17 TESTS 29 31 1024000
173266413 Shuai. C Sept. 24, 2022, 3:58 a.m. OK GNU C++17 TESTS 29 31 1126400
173263544 dalek114514 C Sept. 24, 2022, 3:16 a.m. OK GNU C++17 TESTS 29 31 2048000
173274165 TanSinTheta C Sept. 24, 2022, 5:41 a.m. OK GNU C++17 TESTS 29 31 2048000
173267704 ace_coder C Sept. 24, 2022, 4:18 a.m. OK GNU C++17 TESTS 29 31 2048000
173253772 Samar.Mahmoud C Sept. 23, 2022, 6:58 p.m. OK GNU C++17 TESTS 29 31 2048000
173250242 mona04 C Sept. 23, 2022, 6:18 p.m. OK GNU C++17 TESTS 29 31 2048000
173250117 nahin_narcissus C Sept. 23, 2022, 6:17 p.m. OK GNU C++17 TESTS 29 31 2048000
173248785 bloodoath C Sept. 23, 2022, 6:03 p.m. OK GNU C++17 TESTS 29 31 2048000
173240779 RohitRKS C Sept. 23, 2022, 4:40 p.m. OK GNU C++17 (64) TESTS 29 30 2048000
173261891 iprom C Sept. 24, 2022, 2:48 a.m. OK GNU C++17 (64) TESTS 29 30 4096000
173225879 Jakon C Sept. 23, 2022, 2:42 p.m. OK GNU C++17 (64) TESTS 29 31 2048000
173234494 Muly C Sept. 23, 2022, 3:42 p.m. OK GNU C++17 (64) TESTS 29 31 2048000
173225981 Rick_GT C Sept. 23, 2022, 2:42 p.m. OK GNU C++17 (64) TESTS 29 31 2048000
173244467 jisanahmed10667 C Sept. 23, 2022, 5:16 p.m. OK GNU C++17 (64) TESTS 29 31 2048000
173231837 ayushhad7 C Sept. 23, 2022, 3:22 p.m. OK GNU C++17 (64) TESTS 29 31 2048000
173237943 cuiaoxiang C Sept. 23, 2022, 4:13 p.m. OK GNU C++17 (64) TESTS 29 31 2355200
173262693 Eternal.. C Sept. 24, 2022, 3:02 a.m. OK GNU C++17 (64) TESTS 29 31 2969600
173260346 c1120231020 C Sept. 24, 2022, 1:24 a.m. OK GNU C++17 (64) TESTS 29 31 3072000
173257502 devasadbek C Sept. 23, 2022, 7:47 p.m. OK GNU C++20 (64) TESTS 29 31 1024000
173238903 Luv_Ray C Sept. 23, 2022, 4:23 p.m. OK GNU C++20 (64) TESTS 29 31 1024000
173225636 Patel45 C Sept. 23, 2022, 2:41 p.m. OK GNU C++20 (64) TESTS 29 31 1024000
173274951 Dump_Coder C Sept. 24, 2022, 5:49 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173272133 hartiksalaria C Sept. 24, 2022, 5:19 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173266434 ld10 C Sept. 24, 2022, 3:59 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173265118 GoogleBot C Sept. 24, 2022, 3:36 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173265059 mrSNOW C Sept. 24, 2022, 3:35 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173263964 Chao_zi C Sept. 24, 2022, 3:20 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173263083 _BottomCoder_ C Sept. 24, 2022, 3:08 a.m. OK GNU C++20 (64) TESTS 29 31 2150400
173220761 koqo C Sept. 23, 2022, 2:01 p.m. OK Go TESTS 29 124 5222400
173263502 the_unseen C Sept. 24, 2022, 3:15 a.m. OK Java 11 TESTS 29 218 0
173239283 vijender_8601 C Sept. 23, 2022, 4:26 p.m. OK Java 11 TESTS 29 218 0
173226501 imMortalSuv C Sept. 23, 2022, 2:45 p.m. OK Java 11 TESTS 29 233 0
173273904 g_square C Sept. 24, 2022, 5:38 a.m. OK Java 11 TESTS 29 264 0
173262881 Spidey2182 C Sept. 24, 2022, 3:05 a.m. OK Java 11 TESTS 29 264 0
173216646 princeayush04 C Sept. 23, 2022, 1:51 p.m. OK Java 11 TESTS 29 264 0
173262204 enuguru_2002 C Sept. 24, 2022, 2:54 a.m. OK Java 11 TESTS 29 265 3788800
173237469 dzhi C Sept. 23, 2022, 4:09 p.m. OK Java 11 TESTS 29 280 0
173244083 Cypher70 C Sept. 23, 2022, 5:12 p.m. OK Java 11 TESTS 29 295 0
173220581 aditya2024 C Sept. 23, 2022, 2 p.m. OK Java 11 TESTS 29 311 0
173226941 kkz666 C Sept. 23, 2022, 2:47 p.m. OK Java 17 TESTS 29 217 102400
173253043 Pratham2908 C Sept. 23, 2022, 6:49 p.m. OK Java 17 TESTS 29 218 614400
173250014 Kedrigern C Sept. 23, 2022, 6:16 p.m. OK Java 17 TESTS 29 218 819200
173263127 Mamimi C Sept. 24, 2022, 3:09 a.m. OK Java 17 TESTS 29 233 819200
173219681 shubhanshu_jha14 C Sept. 23, 2022, 1:58 p.m. OK Java 17 TESTS 29 233 819200
173231143 Ali04 C Sept. 23, 2022, 3:16 p.m. OK Java 17 TESTS 29 264 512000
173228526 CharonXin C Sept. 23, 2022, 2:57 p.m. OK Java 17 TESTS 29 265 4300800
173238512 bakdauletabdumuminov C Sept. 23, 2022, 4:19 p.m. OK Java 17 TESTS 29 327 5324800
173221194 _Abeke_ C Sept. 23, 2022, 2:02 p.m. OK Java 17 TESTS 29 327 6656000
173217316 _NursultaN_ C Sept. 23, 2022, 1:53 p.m. OK Java 17 TESTS 29 358 7270400
173226792 imMortalSuv C Sept. 23, 2022, 2:46 p.m. OK Java 8 TESTS 29 140 0
173259695 Diaa12360 C Sept. 23, 2022, 8:22 p.m. OK Java 8 TESTS 29 155 0
173259303 akarshanand2810 C Sept. 23, 2022, 8:15 p.m. OK Java 8 TESTS 29 155 0
173232604 Mohamed_A7med C Sept. 23, 2022, 3:28 p.m. OK Java 8 TESTS 29 155 0
173224954 Parimal C Sept. 23, 2022, 2:39 p.m. OK Java 8 TESTS 29 156 4505600
173258882 sachinjaiswal C Sept. 23, 2022, 8:08 p.m. OK Java 8 TESTS 29 170 0
173263921 OmarKenawi C Sept. 24, 2022, 3:20 a.m. OK Java 8 TESTS 29 171 0
173248628 swarup_312 C Sept. 23, 2022, 6:02 p.m. OK Java 8 TESTS 29 171 0
173238266 Virendra115 C Sept. 23, 2022, 4:16 p.m. OK Java 8 TESTS 29 171 0
173246571 Kaldaruly C Sept. 23, 2022, 5:40 p.m. OK Java 8 TESTS 29 186 0
173256939 laquendi C Sept. 23, 2022, 7:38 p.m. OK MS C++ 2017 TESTS 29 46 5939200
173219950 petrushka29435 C Sept. 23, 2022, 1:59 p.m. OK MS C++ 2017 TESTS 29 62 9318400
173218192 komalsatwik2002 C Sept. 23, 2022, 1:55 p.m. OK MS C++ 2017 TESTS 29 77 1945600
173227295 Ahmedmadbouly186 C Sept. 23, 2022, 2:49 p.m. OK MS C++ 2017 TESTS 29 280 5017600
173241722 wojciechkomor C Sept. 23, 2022, 4:49 p.m. OK Node.js TESTS 29 358 40755200
173270064 yoralbayev C Sept. 24, 2022, 4:53 a.m. OK PHP TESTS 29 1465 4198400
173226673 1_2_3_4_5_9 C Sept. 23, 2022, 2:45 p.m. OK PyPy 2 TESTS 29 1216 89395200
173228724 _Saacosta C Sept. 23, 2022, 2:58 p.m. OK PyPy 3 TESTS 29 374 10649600
173228845 wildling C Sept. 23, 2022, 2:59 p.m. OK PyPy 3 TESTS 29 405 9728000
173231828 _Saacosta C Sept. 23, 2022, 3:22 p.m. OK PyPy 3 TESTS 29 420 14643200
173266632 Chanzan C Sept. 24, 2022, 4:02 a.m. OK PyPy 3 TESTS 29 468 16281600
173272860 fathorse C Sept. 24, 2022, 5:27 a.m. OK PyPy 3 TESTS 29 482 32460800
173271535 34z12000 C Sept. 24, 2022, 5:12 a.m. OK PyPy 3 TESTS 29 483 15769600
173217820 fancyFox C Sept. 23, 2022, 1:54 p.m. OK PyPy 3 TESTS 29 483 31948800
173266666 Chanzan C Sept. 24, 2022, 4:03 a.m. OK PyPy 3 TESTS 29 530 16281600
173225140 _Saacosta C Sept. 23, 2022, 2:39 p.m. OK PyPy 3 TESTS 29 638 53657600
173241938 hash1023 C Sept. 23, 2022, 4:51 p.m. OK PyPy 3 TESTS 29 904 34611200
173240439 IndexError C Sept. 23, 2022, 4:37 p.m. OK PyPy 3-64 TESTS 29 187 14131200
173267421 voicon C Sept. 24, 2022, 4:14 a.m. OK PyPy 3-64 TESTS 29 249 13107200
173232937 IndexError C Sept. 23, 2022, 3:30 p.m. OK PyPy 3-64 TESTS 29 264 13209600
173274842 Youarenotgood C Sept. 24, 2022, 5:48 a.m. OK PyPy 3-64 TESTS 29 280 12288000
173228238 minal.singh C Sept. 23, 2022, 2:55 p.m. OK PyPy 3-64 TESTS 29 280 13107200
173228313 MohamedHamed123 C Sept. 23, 2022, 2:55 p.m. OK PyPy 3-64 TESTS 29 280 13312000
173231857 bokunopicolo C Sept. 23, 2022, 3:22 p.m. OK PyPy 3-64 TESTS 29 280 21708800
173235254 biglunchdude C Sept. 23, 2022, 3:48 p.m. OK PyPy 3-64 TESTS 29 311 12800000
173231757 Yansou C Sept. 23, 2022, 3:21 p.m. OK PyPy 3-64 TESTS 29 326 12902400
173226522 lox123 C Sept. 23, 2022, 2:45 p.m. OK PyPy 3-64 TESTS 29 342 15257600
173247280 kobae964 C Sept. 23, 2022, 5:48 p.m. OK Rust 2021 TESTS 29 62 10137600
173233239 liut C Sept. 23, 2022, 3:32 p.m. OK Rust 2021 TESTS 29 109 9625600
173234098 liut C Sept. 23, 2022, 3:39 p.m. OK Rust 2021 TESTS 29 171 13824000
173234022 liut C Sept. 23, 2022, 3:38 p.m. OK Rust 2021 TESTS 29 202 13824000
173226343 Avanta C Sept. 23, 2022, 2:44 p.m. OK Rust 2021 TESTS 29 795 166604800

remove filters

Back to search problems