Codeforces Round 610 (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
1282 Codeforces Round 610 (Div. 2) FINISHED False 7200 154625099 Dec. 24, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10277 ) B2 K for the Price of One (Hard Version) PROGRAMMING dp greedy sortings 1600

B'This is the hard version of this problem. The only difference is the constraint on k -- the number of gifts in the offer. In this version: 2 <= k <= n . Vasya came to the store to buy goods for his friends for the New Year. It turned out that he was very lucky -- today the offer " k of goods for the price of one" is held in store. Using this offer, Vasya can buy exactly k of any goods, paying only for the most expensive of them. Vasya decided to take this opportunity and buy as many goods as possible for his friends with the money he has. More formally, for each good, its price is determined by a_i -- the number of coins it costs. Initially, Vasya has p coins. He wants to buy the maximum number of goods. Vasya can perform one of the following operations as many times as necessary: Please note that each good can be bought no more than once. For example, if the store now has n=5 goods worth a_1=2, a_2=4, a_3=3, a_4=5, a_5=7 , respectively, k=2 , and Vasya has 6 coins, then he can buy 3 goods. A good with the index 1 will be bought by Vasya without using the offer and he will pay 2 coins. Goods with the indices 2 and 3 Vasya will buy using the offer and he will pay 4 coins. It can be proved that Vasya can not buy more goods with six coins. Help Vasya to find out the maximum number of goods he can buy. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the test. The next lines contain a description of t test cases. The first line of each test case contains three integers n, p, k ( 2 <= n <= 2 cdot 10^5 , 1 <= p <= 2 cdot10^9 , 2 <= k <= n ) -- the number of goods in the store, the number of coins Vasya has and the number of goods that can be bought by the price of the most expensive of them. The second line of each test case contains n integers a_i ( 1 <= a_i <= '...

Tutorials

72461

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
67560776 crazy__1234 B2 Dec. 24, 2019, 5:30 p.m. OK Clang++17 Diagnostics TESTS 19 935 19558400 1600
67536602 avm B2 Dec. 24, 2019, 3:11 p.m. OK D TESTS 19 62 25292800 1600
68628844 rr_ B2 Jan. 12, 2020, 1:14 a.m. OK D TESTS 19 77 11571200 1600
67546611 iica B2 Dec. 24, 2019, 3:51 p.m. OK D TESTS 19 77 11673600 1600
67546339 ruban B2 Dec. 24, 2019, 3:50 p.m. OK Delphi TESTS 19 139 128204800 1600
67578400 mth1908 B2 Dec. 25, 2019, 4:27 a.m. OK GNU C11 TESTS 19 78 1638400 1600
67940434 QuisVenator B2 Dec. 30, 2019, 12:08 a.m. OK GNU C11 TESTS 19 93 819200 1600
67578653 harsha.pathuri B2 Dec. 25, 2019, 4:38 a.m. OK GNU C11 TESTS 19 93 1638400 1600
67570553 kaiboy B2 Dec. 24, 2019, 9:48 p.m. OK GNU C11 TESTS 19 93 1638400 1600
67546312 rahulgoel B2 Dec. 24, 2019, 3:49 p.m. OK GNU C11 TESTS 19 93 3174400 1600
67547658 rainboy B2 Dec. 24, 2019, 3:56 p.m. OK GNU C11 TESTS 19 108 1638400 1600
67537729 FE40536 B2 Dec. 24, 2019, 3:15 p.m. OK GNU C11 TESTS 19 109 819200 1600
67565337 akash19jain B2 Dec. 24, 2019, 7:03 p.m. OK GNU C11 TESTS 19 109 3174400 1600
67607910 tushar3105 B2 Dec. 25, 2019, 2:16 p.m. OK GNU C11 TESTS 19 124 7168000 1600
67608477 ikeirsq B2 Dec. 25, 2019, 2:27 p.m. OK GNU C11 TESTS 19 390 1228800 1600
67955161 luogu_bot5 B2 Dec. 30, 2019, 9:20 a.m. OK GNU C++11 TESTS 19 31 819200 1600
67948546 yuzhechuan B2 Dec. 30, 2019, 6:37 a.m. OK GNU C++11 TESTS 19 31 819200 1600
67634885 DWAE86 B2 Dec. 26, 2019, 6:22 a.m. OK GNU C++11 TESTS 19 31 1433600 1600
67575057 Ultflash B2 Dec. 25, 2019, 1:07 a.m. OK GNU C++11 TESTS 19 31 1638400 1600
69202176 vjudge4 B2 Jan. 20, 2020, 4:54 p.m. OK GNU C++11 TESTS 19 31 1638400 1600
68763438 zhumingyang B2 Jan. 14, 2020, 9:01 a.m. OK GNU C++11 TESTS 19 31 1638400 1600
67529172 Sooke_Believer B2 Dec. 24, 2019, 2:45 p.m. OK GNU C++11 TESTS 19 31 1638400 1600
67532718 24680esz B2 Dec. 24, 2019, 2:57 p.m. OK GNU C++11 TESTS 19 31 3072000 1600
67552226 Lxzy_Zby B2 Dec. 24, 2019, 4:16 p.m. OK GNU C++11 TESTS 19 31 3174400 1600
67541292 wannaAC B2 Dec. 24, 2019, 3:29 p.m. OK GNU C++11 TESTS 19 31 3993600 1600
67549932 KaguraNana B2 Dec. 24, 2019, 4:06 p.m. OK GNU C++14 TESTS 19 31 921600 1600
68592668 tokitsukaze B2 Jan. 11, 2020, 1:07 p.m. OK GNU C++14 TESTS 19 31 921600 1600
67577186 wronganswer B2 Dec. 25, 2019, 3:28 a.m. OK GNU C++14 TESTS 19 46 3993600 1600
67529121 hyhtsdy B2 Dec. 24, 2019, 2:45 p.m. OK GNU C++14 TESTS 19 46 9011200 1600
67577322 k5888200 B2 Dec. 25, 2019, 3:35 a.m. OK GNU C++14 TESTS 19 61 819200 1600
67634604 R99 B2 Dec. 26, 2019, 6:12 a.m. OK GNU C++14 TESTS 19 61 819200 1600
67587830 Nitish_cet B2 Dec. 25, 2019, 8:58 a.m. OK GNU C++14 TESTS 19 61 819200 1600
68040501 rk42745417 B2 Jan. 1, 2020, 2:05 p.m. OK GNU C++14 TESTS 19 61 1638400 1600
67567105 adyyy B2 Dec. 24, 2019, 7:51 p.m. OK GNU C++14 TESTS 19 61 2048000 1600
67559329 ac_97 B2 Dec. 24, 2019, 5:11 p.m. OK GNU C++14 TESTS 19 61 2457600 1600
67764014 lavin B2 Dec. 28, 2019, 1:56 a.m. OK GNU C++17 TESTS 19 46 819200 1600
67649743 Funny_digit B2 Dec. 26, 2019, 11:38 a.m. OK GNU C++17 TESTS 19 46 1228800 1600
67649537 Funny_digit B2 Dec. 26, 2019, 11:34 a.m. OK GNU C++17 TESTS 19 46 1228800 1600
67566445 WrongAnswerOnTest1 B2 Dec. 24, 2019, 7:33 p.m. OK GNU C++17 TESTS 19 46 1638400 1600
67587873 CQXYM B2 Dec. 25, 2019, 8:58 a.m. OK GNU C++17 TESTS 19 46 2355200 1600
68388468 butflfe B2 Jan. 8, 2020, 7:20 a.m. OK GNU C++17 TESTS 19 61 819200 1600
67579142 lijiatu B2 Dec. 25, 2019, 4:57 a.m. OK GNU C++17 TESTS 19 61 1536000 1600
67566193 hysoka79 B2 Dec. 24, 2019, 7:24 p.m. OK GNU C++17 TESTS 19 61 1638400 1600
67961252 jiangly B2 Dec. 30, 2019, 11:39 a.m. OK GNU C++17 TESTS 19 61 1638400 1600
67546276 dgrmsh B2 Dec. 24, 2019, 3:49 p.m. OK GNU C++17 TESTS 19 61 1638400 1600
67868130 maguroguma B2 Dec. 29, 2019, 10:25 a.m. OK Go TESTS 19 109 0 1600
67535413 caidodo0_0 B2 Dec. 24, 2019, 3:06 p.m. OK Go TESTS 19 187 0 1600
68084069 Anonymous B2 Jan. 2, 2020, 3:31 p.m. OK Java 11 TESTS 19 202 0 1600
67586639 Azakarka B2 Dec. 25, 2019, 8:33 a.m. OK Java 11 TESTS 19 202 0 1600
67529619 Lewin B2 Dec. 24, 2019, 2:46 p.m. OK Java 11 TESTS 19 202 0 1600
68096663 rohithsajith B2 Jan. 2, 2020, 9:21 p.m. OK Java 11 TESTS 19 217 0 1600
67534071 bleh0.5 B2 Dec. 24, 2019, 3:01 p.m. OK Java 11 TESTS 19 218 0 1600
67652831 its_aks_ulure B2 Dec. 26, 2019, 12:49 p.m. OK Java 11 TESTS 19 218 0 1600
67564765 ankyy_0103 B2 Dec. 24, 2019, 6:49 p.m. OK Java 11 TESTS 19 218 0 1600
68091589 about B2 Jan. 2, 2020, 6:24 p.m. OK Java 11 TESTS 19 233 102400 1600
67537593 lightseba B2 Dec. 24, 2019, 3:14 p.m. OK Java 11 TESTS 19 248 9932800 1600
67537637 potatmen B2 Dec. 24, 2019, 3:15 p.m. OK Java 11 TESTS 19 264 3174400 1600
67676335 bluesky111 B2 Dec. 27, 2019, 2:18 a.m. OK Java 8 TESTS 19 124 0 1600
67598525 Apurva021 B2 Dec. 25, 2019, 11:05 a.m. OK Java 8 TESTS 19 124 0 1600
67696326 alireza_sh B2 Dec. 27, 2019, 1 p.m. OK Java 8 TESTS 19 139 0 1600
67960193 luchy0120 B2 Dec. 30, 2019, 11:15 a.m. OK Java 8 TESTS 19 140 0 1600
67771271 charkhan B2 Dec. 28, 2019, 6:54 a.m. OK Java 8 TESTS 19 140 0 1600
67697305 alireza_sh B2 Dec. 27, 2019, 1:19 p.m. OK Java 8 TESTS 19 140 0 1600
67633975 amolpratap007 B2 Dec. 26, 2019, 5:51 a.m. OK Java 8 TESTS 19 140 0 1600
67569188 Mann_27__ B2 Dec. 24, 2019, 8:53 p.m. OK Java 8 TESTS 19 140 0 1600
67558557 KharYusuf B2 Dec. 24, 2019, 5:03 p.m. OK Java 8 TESTS 19 140 0 1600
67547187 bhavyashah9873 B2 Dec. 24, 2019, 3:53 p.m. OK Java 8 TESTS 19 140 0 1600
68964498 Spheniscine B2 Jan. 17, 2020, 3:54 a.m. OK Kotlin TESTS 19 187 5222400 1600
67671985 slemus B2 Dec. 26, 2019, 9:07 p.m. OK Kotlin TESTS 19 327 14643200 1600
67536470 old_boo B2 Dec. 24, 2019, 3:10 p.m. OK Kotlin TESTS 19 405 15769600 1600
67570130 a11eca B2 Dec. 24, 2019, 9:31 p.m. OK Kotlin TESTS 19 483 4915200 1600
67530155 camypaper B2 Dec. 24, 2019, 2:48 p.m. OK Mono C# TESTS 19 93 3891200 1600
69517150 tomomo2b2 B2 Jan. 25, 2020, 12:21 p.m. OK Mono C# TESTS 19 124 20480000 1600
68864784 artworks B2 Jan. 15, 2020, 1:13 p.m. OK Mono C# TESTS 19 140 20992000 1600
68437803 sevimlikedicik B2 Jan. 9, 2020, 9:39 a.m. OK Mono C# TESTS 19 156 14848000 1600
69430529 nastya1199 B2 Jan. 23, 2020, 5:11 p.m. OK Mono C# TESTS 19 186 16998400 1600
67555630 hyzhangzhy B2 Dec. 24, 2019, 4:30 p.m. OK Mono C# TESTS 19 202 22937600 1600
68083613 SpinDOS B2 Jan. 2, 2020, 3:19 p.m. OK Mono C# TESTS 19 202 23552000 1600
68432803 keymoon B2 Jan. 9, 2020, 7:39 a.m. OK Mono C# TESTS 19 217 25088000 1600
67559608 plasma-effect B2 Dec. 24, 2019, 5:14 p.m. OK Mono C# TESTS 19 218 20582400 1600
67535032 Yupiteru B2 Dec. 24, 2019, 3:05 p.m. OK Mono C# TESTS 19 233 175411200 1600
68340962 vjudge5 B2 Jan. 7, 2020, 3:34 a.m. OK MS C++ TESTS 19 46 1638400 1600
68313345 vjudge3 B2 Jan. 6, 2020, 12:13 p.m. OK MS C++ TESTS 19 46 2355200 1600
67625691 r57shell B2 Dec. 25, 2019, 9:34 p.m. OK MS C++ TESTS 19 46 3481600 1600
68697142 vjudge2 B2 Jan. 13, 2020, 8:17 a.m. OK MS C++ TESTS 19 61 3174400 1600
67625686 r57shell B2 Dec. 25, 2019, 9:33 p.m. OK MS C++ TESTS 19 61 3481600 1600
68339994 vjudge5 B2 Jan. 7, 2020, 2:35 a.m. OK MS C++ TESTS 19 62 819200 1600
67540793 tarattata1 B2 Dec. 24, 2019, 3:27 p.m. OK MS C++ TESTS 19 62 1638400 1600
67576616 tarattata1 B2 Dec. 25, 2019, 2:58 a.m. OK MS C++ TESTS 19 62 1638400 1600
68588291 vjudge1 B2 Jan. 11, 2020, 11:56 a.m. OK MS C++ TESTS 19 62 10240000 1600
67631682 vjudge3 B2 Dec. 26, 2019, 4:27 a.m. OK MS C++ TESTS 19 77 3276800 1600
68688691 116c B2 Jan. 13, 2020, 5 a.m. OK MS C++ 2017 TESTS 19 77 3174400 1600
67604994 5130 B2 Dec. 25, 2019, 1:16 p.m. OK MS C++ 2017 TESTS 19 78 819200 1600
67535162 IronArt B2 Dec. 24, 2019, 3:05 p.m. OK MS C++ 2017 TESTS 19 78 819200 1600
67550652 Tangerine B2 Dec. 24, 2019, 4:09 p.m. OK MS C++ 2017 TESTS 19 78 1638400 1600
68118817 Sleepymint B2 Jan. 3, 2020, 12:30 p.m. OK MS C++ 2017 TESTS 19 78 1638400 1600
67877880 jasminehe B2 Dec. 29, 2019, 2:01 p.m. OK MS C++ 2017 TESTS 19 78 1638400 1600
67680960 pichulia B2 Dec. 27, 2019, 6:22 a.m. OK MS C++ 2017 TESTS 19 78 1638400 1600
67626543 P___ B2 Dec. 25, 2019, 10:21 p.m. OK MS C++ 2017 TESTS 19 78 3379200 1600
67955729 hxx_ustc B2 Dec. 30, 2019, 9:34 a.m. OK MS C++ 2017 TESTS 19 93 2560000 1600
67540812 youx B2 Dec. 24, 2019, 3:27 p.m. OK MS C++ 2017 TESTS 19 93 9011200 1600
67680807 yumtam B2 Dec. 27, 2019, 6:16 a.m. OK PyPy 2 TESTS 19 233 14745600 1600
67550495 Horse-kun B2 Dec. 24, 2019, 4:08 p.m. OK PyPy 2 TESTS 19 265 16179200 1600
68055786 Gaurav1 B2 Jan. 1, 2020, 10:28 p.m. OK PyPy 2 TESTS 19 311 16588800 1600
67543208 bcollet B2 Dec. 24, 2019, 3:36 p.m. OK PyPy 2 TESTS 19 358 16179200 1600
67564805 iamprayush B2 Dec. 24, 2019, 6:50 p.m. OK PyPy 2 TESTS 19 405 12288000 1600
67545016 Pyar.Mahobat.Dhoka.Hai B2 Dec. 24, 2019, 3:44 p.m. OK PyPy 2 TESTS 19 420 16691200 1600
67945288 MVP B2 Dec. 30, 2019, 4:53 a.m. OK PyPy 2 TESTS 19 436 9830400 1600
67959508 vjudge3 B2 Dec. 30, 2019, 11 a.m. OK PyPy 2 TESTS 19 452 9830400 1600
67683168 Kamsamewar B2 Dec. 27, 2019, 7:29 a.m. OK PyPy 2 TESTS 19 498 10854400 1600
67657784 soumyasarkar1998 B2 Dec. 26, 2019, 2:33 p.m. OK PyPy 2 TESTS 19 530 10854400 1600
67669434 mdaw B2 Dec. 26, 2019, 7:28 p.m. OK PyPy 3 TESTS 19 280 17203200 1600
67566772 ng24_7 B2 Dec. 24, 2019, 7:41 p.m. OK PyPy 3 TESTS 19 280 17203200 1600
67560732 thekushalghosh B2 Dec. 24, 2019, 5:30 p.m. OK PyPy 3 TESTS 19 280 17612800 1600
67560551 Coki628 B2 Dec. 24, 2019, 5:27 p.m. OK PyPy 3 TESTS 19 295 16588800 1600
67538204 vit_72 B2 Dec. 24, 2019, 3:17 p.m. OK PyPy 3 TESTS 19 295 17203200 1600
67534529 titia B2 Dec. 24, 2019, 3:03 p.m. OK PyPy 3 TESTS 19 295 17612800 1600
67543021 auouo B2 Dec. 24, 2019, 3:35 p.m. OK PyPy 3 TESTS 19 296 17612800 1600
67669574 mdaw B2 Dec. 26, 2019, 7:33 p.m. OK PyPy 3 TESTS 19 311 17203200 1600
67580349 codershuvo B2 Dec. 25, 2019, 5:41 a.m. OK PyPy 3 TESTS 19 311 17203200 1600
67578647 sam997 B2 Dec. 25, 2019, 4:38 a.m. OK PyPy 3 TESTS 19 311 19456000 1600
67536004 nwi B2 Dec. 24, 2019, 3:08 p.m. OK Python 2 TESTS 19 420 11059200 1600
68139668 SoSooding B2 Jan. 3, 2020, 9:09 p.m. OK Python 2 TESTS 19 436 11059200 1600
67536999 anonymous0314 B2 Dec. 24, 2019, 3:12 p.m. OK Python 2 TESTS 19 436 11980800 1600
67549260 Kagemeka B2 Dec. 24, 2019, 4:03 p.m. OK Python 3 TESTS 19 218 14336000 1600
67608044 mstr_shifu B2 Dec. 25, 2019, 2:19 p.m. OK Python 3 TESTS 19 311 14336000 1600
67536168 r57shell B2 Dec. 24, 2019, 3:09 p.m. OK Python 3 TESTS 19 343 14336000 1600
68724268 Stephan B2 Jan. 13, 2020, 5:22 p.m. OK Python 3 TESTS 19 358 14336000 1600
67613060 n0body9200 B2 Dec. 25, 2019, 4:06 p.m. OK Python 3 TESTS 19 358 14336000 1600
67628579 PEPElotas B2 Dec. 26, 2019, 1:01 a.m. OK Python 3 TESTS 19 374 14131200 1600
67543018 rached13 B2 Dec. 24, 2019, 3:35 p.m. OK Python 3 TESTS 19 374 14336000 1600
68463111 bhy_ahmed B2 Jan. 9, 2020, 6:56 p.m. OK Python 3 TESTS 19 374 14950400 1600
67646825 Annvv B2 Dec. 26, 2019, 10:31 a.m. OK Python 3 TESTS 19 374 17305600 1600
67854871 justAmanGupta B2 Dec. 29, 2019, 5:36 a.m. OK Python 3 TESTS 19 389 14336000 1600
67533917 tuna_salad B2 Dec. 24, 2019, 3:01 p.m. OK Rust TESTS 19 46 5324800 1600
68953052 sansen B2 Jan. 16, 2020, 6:47 p.m. OK Rust TESTS 19 61 9216000 1600
67536505 yakamoto B2 Dec. 24, 2019, 3:10 p.m. OK Scala TESTS 19 421 0 1600
68351119 reldan B2 Jan. 7, 2020, 9:54 a.m. OK Scala TESTS 19 748 14438400 1600

remove filters

Back to search problems