Codeforces Round 809 (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
1706 Codeforces Round 809 (Div. 2) FINISHED False 7200 79111463 July 18, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7132 ) D1 Chopping Carrots (Easy Version) PROGRAMMING binary search brute force constructive algorithms dp greedy number theory

B'This is the easy version of the problem. The only difference between the versions is the constraints on n , k , a_i , and the sum of n over all test cases. You can make hacks only if both versions of the problem are solved. Note the unusual memory limit. You are given an array of integers a_1, a_2, ldots, a_n of length n , and an integer k . The cost of an array of integers p_1, p_2, ldots, p_n of length n is max limits_{1 <= i <= n} <= ft( <= ft lfloor frac{a_i}{p_i} right rfloor right) - min limits_{1 <= i <= n} <= ft( <= ft lfloor frac{a_i}{p_i} right rfloor right). Here, lfloor frac{x}{y} rfloor denotes the integer part of the division of x by y . Find the minimum cost of an array p such that 1 <= p_i <= k for all 1 <= i <= n . The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 1 <= n, k <= 3000 ). The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_1 <= a_2 <= ldots <= a_n <= 3000 ). It is guaranteed that the sum of n over all test cases does not exceed 3000 . For each test case, print a single integer -- the minimum possible cost of an array p satisfying the condition above. In the first test case, the optimal array is p = [1, 1, 1, 2, 2] . The resulting array of values of lfloor frac{a_i}{p_i} rfloor is [4, 5, 6, 4, 5] . The cost of p is max limits_{1 <= i <= n}( lfloor frac{a_i}{p_i} rfloor) - min limits_{1 <= i <= n}( lfloor frac{a_i}{p_i} rfloor) = 6 - 4 = 2 . We can show that there is no array (satisfying the condition from the statement) with a smaller cost. In the second test case, one of the optimal arrays is p = [12, 12, 12, 12, 12] , which results in all lfloor frac{a_i}{p_i} rfloor be'...

Tutorials

Codeforces Round #809 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
164839233 szzz- D1 July 19, 2022, 3:07 a.m. OK C# 10 TESTS 64 218 204800
164808176 mban259 D1 July 18, 2022, 6:51 p.m. OK C# 10 TESTS 64 420 512000
164813694 NenadDapic D1 July 18, 2022, 7:52 p.m. OK FPC TESTS 64 202 102400
164800771 rainboy D1 July 18, 2022, 5:43 p.m. OK GNU C11 TESTS 64 46 819200
164790655 CodingJellyfish D1 July 18, 2022, 4:28 p.m. OK GNU C11 TESTS 64 62 2048000
164837957 unbecoming D1 July 19, 2022, 2:50 a.m. OK GNU C++14 TESTS 64 15 204800
164787553 2018ljw D1 July 18, 2022, 4:21 p.m. OK GNU C++14 TESTS 64 15 2355200
164829472 Sparkle_ZH D1 July 19, 2022, 12:54 a.m. OK GNU C++14 TESTS 64 30 1331200
164837854 Ender_hz D1 July 19, 2022, 2:49 a.m. OK GNU C++14 TESTS 64 31 0
164823187 egorqwq D1 July 18, 2022, 10:21 p.m. OK GNU C++14 TESTS 64 31 204800
164823470 Dispensable D1 July 18, 2022, 10:28 p.m. OK GNU C++14 TESTS 64 31 409600
164825465 zzlzzlzzl D1 July 18, 2022, 11:16 p.m. OK GNU C++14 TESTS 64 31 819200
164827949 SpringWait D1 July 19, 2022, 12:22 a.m. OK GNU C++14 TESTS 64 31 819200
164841211 Nondifferentiable D1 July 19, 2022, 3:32 a.m. OK GNU C++14 TESTS 64 31 819200
164844438 __stick D1 July 19, 2022, 4:19 a.m. OK GNU C++14 TESTS 64 31 921600
164812329 Bobocan D1 July 18, 2022, 7:37 p.m. OK GNU C++17 TESTS 64 15 614400
164846774 X_o_r D1 July 19, 2022, 4:57 a.m. OK GNU C++17 TESTS 64 15 819200
164810597 beginner_boy D1 July 18, 2022, 7:19 p.m. OK GNU C++17 TESTS 64 31 102400
164840259 wwwwwwjj D1 July 19, 2022, 3:20 a.m. OK GNU C++17 TESTS 64 31 102400
164840796 deities D1 July 19, 2022, 3:27 a.m. OK GNU C++17 TESTS 64 31 102400
164850037 therealslimshady_ D1 July 19, 2022, 5:41 a.m. OK GNU C++17 TESTS 64 31 307200
164816496 DanielChang D1 July 18, 2022, 8:26 p.m. OK GNU C++17 TESTS 64 31 307200
164814969 PinoF D1 July 18, 2022, 8:07 p.m. OK GNU C++17 TESTS 64 31 512000
164844896 Tioz0 D1 July 19, 2022, 4:26 a.m. OK GNU C++17 TESTS 64 31 819200
164801962 mehtaji D1 July 18, 2022, 5:53 p.m. OK GNU C++17 TESTS 64 31 921600
164802517 Kude D1 July 18, 2022, 5:57 p.m. OK GNU C++17 (64) TESTS 64 15 921600
164788272 ggcoder D1 July 18, 2022, 4:22 p.m. OK GNU C++17 (64) TESTS 64 15 3276800
164800879 maxcruickshanks D1 July 18, 2022, 5:44 p.m. OK GNU C++17 (64) TESTS 64 15 7270400
164815620 jesse_pinkman_619 D1 July 18, 2022, 8:15 p.m. OK GNU C++17 (64) TESTS 64 30 409600
164791387 Dinosaur_X D1 July 18, 2022, 4:29 p.m. OK GNU C++17 (64) TESTS 64 31 0
164800486 Kude D1 July 18, 2022, 5:41 p.m. OK GNU C++17 (64) TESTS 64 31 102400
164809053 bashkort D1 July 18, 2022, 7:01 p.m. OK GNU C++17 (64) TESTS 64 31 409600
164798669 huangxiaohua D1 July 18, 2022, 5:30 p.m. OK GNU C++17 (64) TESTS 64 31 512000
164841720 KaJo D1 July 19, 2022, 3:39 a.m. OK GNU C++17 (64) TESTS 64 31 819200
164833294 erdaixianyu007 D1 July 19, 2022, 1:51 a.m. OK GNU C++17 (64) TESTS 64 31 1843200
164788183 vipjml D1 July 18, 2022, 4:22 p.m. OK GNU C++20 (64) TESTS 64 15 102400
164847350 dutin D1 July 19, 2022, 5:05 a.m. OK GNU C++20 (64) TESTS 64 31 0
164844657 HappyPacMan D1 July 19, 2022, 4:23 a.m. OK GNU C++20 (64) TESTS 64 31 102400
164812418 naman1601 D1 July 18, 2022, 7:37 p.m. OK GNU C++20 (64) TESTS 64 31 102400
164843910 ftiasch D1 July 19, 2022, 4:10 a.m. OK GNU C++20 (64) TESTS 64 31 204800
164806817 zidder D1 July 18, 2022, 6:37 p.m. OK GNU C++20 (64) TESTS 64 31 204800
164815156 rohan_singh_07 D1 July 18, 2022, 8:09 p.m. OK GNU C++20 (64) TESTS 64 31 307200
164798635 dean.menezes D1 July 18, 2022, 5:29 p.m. OK GNU C++20 (64) TESTS 64 31 307200
164817663 czhang2718 D1 July 18, 2022, 8:42 p.m. OK GNU C++20 (64) TESTS 64 31 409600
164843292 yangster67 D1 July 19, 2022, 4:01 a.m. OK GNU C++20 (64) TESTS 64 31 409600
164824878 pili D1 July 18, 2022, 11:01 p.m. OK Go TESTS 64 2152 204800
164838903 Wuya D1 July 19, 2022, 3:03 a.m. OK Java 11 TESTS 64 233 0
164826674 dzhi D1 July 18, 2022, 11:48 p.m. OK Java 11 TESTS 64 248 2048000
164818196 NO__OB D1 July 18, 2022, 8:50 p.m. OK Java 11 TESTS 64 264 0
164788283 js2585 D1 July 18, 2022, 4:22 p.m. OK Java 11 TESTS 64 358 0
164792724 Dukkha D1 July 18, 2022, 4:32 p.m. OK Java 11 TESTS 64 405 0
164798534 OhLee D1 July 18, 2022, 5:29 p.m. OK Java 11 TESTS 64 561 38809600
164793050 MrOtter D1 July 18, 2022, 4:33 p.m. OK Java 11 TESTS 64 608 0
164797400 Nicolas125841 D1 July 18, 2022, 5:25 p.m. OK Java 11 TESTS 64 685 0
164844730 dhruvil_01 D1 July 19, 2022, 4:24 a.m. OK Java 11 TESTS 64 795 39321600
164812666 sachinjaiswal D1 July 18, 2022, 7:40 p.m. OK Java 11 TESTS 64 904 58163200
164803239 Dukkha D1 July 18, 2022, 6:04 p.m. OK Java 17 TESTS 64 295 512000
164793746 humwawe D1 July 18, 2022, 4:34 p.m. OK Java 17 TESTS 64 561 204800
164828146 pili D1 July 19, 2022, 12:27 a.m. OK Java 17 TESTS 64 2510 102400
164808983 Sussykin D1 July 18, 2022, 7:01 p.m. OK Java 8 TESTS 64 124 3481600
164815830 leonlian D1 July 18, 2022, 8:18 p.m. OK Java 8 TESTS 64 139 3481600
164800355 HideBeyondYou D1 July 18, 2022, 5:40 p.m. OK Java 8 TESTS 64 139 3481600
164835041 shaurya024 D1 July 19, 2022, 2:14 a.m. OK Java 8 TESTS 64 311 3891200
164797205 UniversalAdmin D1 July 18, 2022, 5:24 p.m. OK Java 8 TESTS 64 1014 3481600
164791017 zheqing D1 July 18, 2022, 4:29 p.m. OK Java 8 TESTS 64 1465 19968000
164797323 anshulchou_123 D1 July 18, 2022, 5:25 p.m. OK Java 8 TESTS 64 2433 24371200
164809703 serg_alb D1 July 18, 2022, 7:09 p.m. OK Kotlin 1.5 TESTS 64 327 0
164797157 serg_alb D1 July 18, 2022, 5:24 p.m. OK Kotlin 1.5 TESTS 64 343 0
164787649 Triss_Merigold D1 July 18, 2022, 4:21 p.m. OK Kotlin 1.6 TESTS 64 1591 512000
164797750 beckusator D1 July 18, 2022, 5:26 p.m. OK MS C++ 2017 TESTS 64 62 1126400
164840027 M_zhi D1 July 19, 2022, 3:16 a.m. OK MS C++ 2017 TESTS 64 78 204800
164788910 Alexey D1 July 18, 2022, 4:24 p.m. OK MS C++ 2017 TESTS 64 155 2150400
164793192 nikuradze2006 D1 July 18, 2022, 4:33 p.m. OK MS C++ 2017 TESTS 64 2355 512000
164804009 klindyuk D1 July 18, 2022, 6:10 p.m. OK PyPy 3 TESTS 64 233 2764800
164833414 MuhammadAMMAR D1 July 19, 2022, 1:52 a.m. OK PyPy 3 TESTS 64 326 3379200
164791727 alarm_twelve D1 July 18, 2022, 4:30 p.m. OK PyPy 3 TESTS 64 326 5324800
164832434 MuhammadAMMAR D1 July 19, 2022, 1:39 a.m. OK PyPy 3 TESTS 64 327 3379200
164801777 shehebe D1 July 18, 2022, 5:51 p.m. OK PyPy 3 TESTS 64 390 6553600
164838682 namans777 D1 July 19, 2022, 3 a.m. OK PyPy 3 TESTS 64 405 10547200
164799265 abineth D1 July 18, 2022, 5:33 p.m. OK PyPy 3 TESTS 64 405 12083200
164793099 hritik3878 D1 July 18, 2022, 4:33 p.m. OK PyPy 3 TESTS 64 545 10444800
164845958 rajeshpenugonda6 D1 July 19, 2022, 4:44 a.m. OK PyPy 3 TESTS 64 1122 9523200
164797931 sushmanth.dampur8780 D1 July 18, 2022, 5:26 p.m. OK PyPy 3 TESTS 64 1309 9216000
164803715 atzhh D1 July 18, 2022, 6:08 p.m. OK PyPy 3-64 TESTS 64 187 5734400
164790913 duck702702 D1 July 18, 2022, 4:28 p.m. OK PyPy 3-64 TESTS 64 233 4198400
164847164 GN6 D1 July 19, 2022, 5:02 a.m. OK PyPy 3-64 TESTS 64 295 4505600
164793236 SophieHatter D1 July 18, 2022, 4:33 p.m. OK PyPy 3-64 TESTS 64 296 3481600
164820347 Girniiiii D1 July 18, 2022, 9:26 p.m. OK PyPy 3-64 TESTS 64 311 4505600
164847600 GN6 D1 July 19, 2022, 5:09 a.m. OK PyPy 3-64 TESTS 64 311 5427200
164847803 GN6 D1 July 19, 2022, 5:12 a.m. OK PyPy 3-64 TESTS 64 327 3993600
164847544 GN6 D1 July 19, 2022, 5:08 a.m. OK PyPy 3-64 TESTS 64 327 4403200
164812850 MistaAsh D1 July 18, 2022, 7:42 p.m. OK PyPy 3-64 TESTS 64 342 4608000
164847889 GN6 D1 July 19, 2022, 5:13 a.m. OK PyPy 3-64 TESTS 64 342 4915200
164832643 Lhohelhohehmm D1 July 19, 2022, 1:42 a.m. OK Python 3 TESTS 64 654 1126400
164791675 atzhh D1 July 18, 2022, 4:30 p.m. OK Python 3 TESTS 64 966 0
164836980 yylele D1 July 19, 2022, 2:38 a.m. OK Python 3 TESTS 64 2636 0
164836691 yylele D1 July 19, 2022, 2:34 a.m. OK Python 3 TESTS 64 2745 0
164788016 yylele D1 July 18, 2022, 4:22 p.m. OK Python 3 TESTS 64 3634 2355200
164831876 bjin D1 July 19, 2022, 1:31 a.m. OK Rust 2021 TESTS 64 46 0
164834108 xttt D1 July 19, 2022, 2:02 a.m. OK Rust 2021 TESTS 64 62 102400
164798734 magnus.hegdahl D1 July 18, 2022, 5:30 p.m. OK Rust 2021 TESTS 64 62 204800
164818851 kena0ki D1 July 18, 2022, 9 p.m. OK Rust 2021 TESTS 64 109 307200

remove filters

Back to search problems