Codeforces Global Round 25

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
1951 Codeforces Global Round 25 FINISHED False 10800 24765863 April 6, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12153 ) C Ticket Hoarding PROGRAMMING greedy math sortings

B'As the CEO of a startup company, you want to reward each of your k employees with a ticket to the upcoming concert. The tickets will be on sale for n days, and by some time travelling, you have predicted that the price per ticket at day i will be a_i . However, to prevent ticket hoarding, the concert organizers have implemented the following measures: For example, if a = [1, 3, 8, 4, 5] and you purchase 2 tickets on day 1 , they will cost 2 in total, and the prices from day 2 onwards will become [5, 10, 6, 7] . If you then purchase 3 more tickets on day 2 , they will cost in total an additional 15 , and the prices from day 3 onwards will become [13, 9, 10] . Find the minimum spending to purchase k tickets. Each test contains multiple test cases. The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains three integers n , m , and k ( 1 <= n <= 3 cdot 10^5, 1 <= m <= 10^9, 1 <= k <= min(nm, 10^9) ) -- the number of sale days, the maximum amount of ticket purchasable each day, and the number of tickets to be bought at the end. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the price per ticket for each of the upcoming n days. It is guaranteed that the sum of n over all test cases does not exceed 3 cdot 10^5 . For each test case, print one integer: the minimum amount of money needed to purchase exactly k tickets. In the first test case, one optimal way to buy 3 tickets is as follows: In the second test case, there is only one way to buy 8 tickets: '...

Tutorials

Codeforces Global Round 25 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
255408507 karamkontar C April 7, 2024, 3:39 a.m. OK C# 10 TESTS 21 171 38502400
255407061 karamkontar C April 7, 2024, 3:18 a.m. OK C# 10 TESTS 21 296 52940800
255412121 Anndy_bonus C April 7, 2024, 4:28 a.m. OK C++14 (GCC 6-32) TESTS 21 124 102400
255407189 dungprozzz C April 7, 2024, 3:20 a.m. OK C++14 (GCC 6-32) TESTS 21 124 102400
255409019 abhi_8923 C April 7, 2024, 3:46 a.m. OK C++14 (GCC 6-32) TESTS 21 125 102400
255413176 lxcxz C April 7, 2024, 4:40 a.m. OK C++14 (GCC 6-32) TESTS 21 125 2457600
255391467 shreyk C April 6, 2024, 10:43 p.m. OK C++14 (GCC 6-32) TESTS 21 140 0
255392370 vishal2045ks C April 6, 2024, 10:58 p.m. OK C++14 (GCC 6-32) TESTS 21 140 102400
255386880 --Magic-- C April 6, 2024, 9:39 p.m. OK C++14 (GCC 6-32) TESTS 21 140 102400
255412517 lxcxz C April 7, 2024, 4:33 a.m. OK C++14 (GCC 6-32) TESTS 21 140 2457600
255405743 Bree_Cui C April 7, 2024, 2:55 a.m. OK C++14 (GCC 6-32) TESTS 21 140 2457600
255401972 qwqer233 C April 7, 2024, 1:53 a.m. OK C++14 (GCC 6-32) TESTS 21 140 2457600
255403120 YakultGo C April 7, 2024, 2:13 a.m. OK C++17 (GCC 7-32) TESTS 21 124 0
255406874 vbsinha C April 7, 2024, 3:15 a.m. OK C++17 (GCC 7-32) TESTS 21 124 102400
255393189 dj_khalid C April 6, 2024, 11:12 p.m. OK C++17 (GCC 7-32) TESTS 21 124 102400
255389007 vedantr_9820 C April 6, 2024, 10:07 p.m. OK C++17 (GCC 7-32) TESTS 21 124 102400
255381050 mayushiii C April 6, 2024, 8:36 p.m. OK C++17 (GCC 7-32) TESTS 21 124 102400
255385946 andrejikus C April 6, 2024, 9:28 p.m. OK C++17 (GCC 7-32) TESTS 21 124 1228800
255369848 happymore C April 6, 2024, 7 p.m. OK C++17 (GCC 7-32) TESTS 21 124 1228800
255398472 rafaielanam01 C April 7, 2024, 12:48 a.m. OK C++17 (GCC 7-32) TESTS 21 124 5529600
255366054 Ferrriccc C April 6, 2024, 6:31 p.m. OK C++17 (GCC 7-32) TESTS 21 124 16486400
255406931 nazeeftham007 C April 7, 2024, 3:16 a.m. OK C++17 (GCC 7-32) TESTS 21 125 102400
255385098 SSYernar C April 6, 2024, 9:18 p.m. OK C++20 (GCC 13-64) TESTS 21 108 4096000
255386983 BitMaster C April 6, 2024, 9:41 p.m. OK C++20 (GCC 13-64) TESTS 21 109 0
255379871 ashu_2004 C April 6, 2024, 8:26 p.m. OK C++20 (GCC 13-64) TESTS 21 109 0
255413522 samarth_1703 C April 7, 2024, 4:45 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255412157 ShadowDrunk C April 7, 2024, 4:28 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255406754 YYYLLL2021 C April 7, 2024, 3:13 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255406290 jackylova_fan_fan_fan C April 7, 2024, 3:05 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255404566 samarth_1703 C April 7, 2024, 2:36 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255404465 samarth_1703 C April 7, 2024, 2:34 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255404084 chauhanrudra0510 C April 7, 2024, 2:28 a.m. OK C++20 (GCC 13-64) TESTS 21 109 102400
255415631 nguyenquocthao00 C April 7, 2024, 5:08 a.m. OK Go TESTS 21 124 12390400
255414847 Specter_TheUnchained C April 7, 2024, 5 a.m. OK Go TESTS 21 202 6758400
255411206 amit_roy C April 7, 2024, 4:16 a.m. OK Java 21 TESTS 21 281 2048000
255377289 krish1832 C April 6, 2024, 8:02 p.m. OK Java 21 TESTS 21 374 7065600
255384767 kbliu C April 6, 2024, 9:14 p.m. OK Java 21 TESTS 21 390 5734400
255410040 2210030113 C April 7, 2024, 4:01 a.m. OK Java 21 TESTS 21 405 5120000
255364516 Fanarill C April 6, 2024, 6:23 p.m. OK Java 21 TESTS 21 421 7987200
255403417 Enderbrine16 C April 7, 2024, 2:18 a.m. OK Java 21 TESTS 21 499 21299200
255368376 testtest111ksjfrdvn C April 6, 2024, 6:48 p.m. OK Java 21 TESTS 21 546 18944000
255409973 _ShenHua_ C April 7, 2024, 4 a.m. OK Java 21 TESTS 21 546 23347200
255379245 mkah123 C April 6, 2024, 8:20 p.m. OK Java 21 TESTS 21 561 22630400
255387979 profchi C April 6, 2024, 9:53 p.m. OK Java 21 TESTS 21 577 27648000
255402728 faresbadr316 C April 7, 2024, 2:07 a.m. OK Java 8 TESTS 21 233 14131200
255393218 SweetAsCocaine C April 6, 2024, 11:12 p.m. OK Java 8 TESTS 21 249 14028800
255356496 Spike.Spiegel C April 6, 2024, 5:26 p.m. OK Java 8 TESTS 21 249 14028800
255365147 Nagendravarma C April 6, 2024, 6:26 p.m. OK Java 8 TESTS 21 280 16076800
255402932 Yousef_Badr C April 7, 2024, 2:10 a.m. OK Java 8 TESTS 21 327 14540800
255402670 faresbadr316 C April 7, 2024, 2:06 a.m. OK Java 8 TESTS 21 327 14540800
255364261 pranavpatil9876 C April 6, 2024, 6:22 p.m. OK Java 8 TESTS 21 374 20070400
255402066 faresbadr316 C April 7, 2024, 1:54 a.m. OK Java 8 TESTS 21 561 35430400
255402170 faresbadr316 C April 7, 2024, 1:56 a.m. OK Java 8 TESTS 21 608 35430400
255363559 Yousef_Badr C April 6, 2024, 6:18 p.m. OK Java 8 TESTS 21 640 35430400
255371002 swapnil_diganta C April 6, 2024, 7:09 p.m. OK PHP TESTS 21 1296 165068800
255359590 manekshaw.rifles C April 6, 2024, 5:33 p.m. OK PHP TESTS 21 1452 184012800
255374448 anshul.py C April 6, 2024, 7:37 p.m. OK PyPy 3 TESTS 21 656 21094400
255366837 __rose C April 6, 2024, 6:37 p.m. OK PyPy 3 TESTS 21 718 25600000
255405974 mikeac C April 7, 2024, 2:59 a.m. OK PyPy 3-64 TESTS 21 218 39014400
255392624 tanmay1610 C April 6, 2024, 11:02 p.m. OK PyPy 3-64 TESTS 21 218 40755200
255392392 tanmay1610 C April 6, 2024, 10:58 p.m. OK PyPy 3-64 TESTS 21 218 40755200
255385432 sanctus C April 6, 2024, 9:22 p.m. OK PyPy 3-64 TESTS 21 218 42496000
255404523 voicon C April 7, 2024, 2:35 a.m. OK PyPy 3-64 TESTS 21 218 45260800
255400661 phungthienphuoc C April 7, 2024, 1:29 a.m. OK PyPy 3-64 TESTS 21 233 41267200
255414087 yuki_keshiki C April 7, 2024, 4:51 a.m. OK PyPy 3-64 TESTS 21 233 45056000
255385362 sanctus C April 6, 2024, 9:21 p.m. OK PyPy 3-64 TESTS 21 234 42598400
255366505 abenezer_m54 C April 6, 2024, 6:34 p.m. OK PyPy 3-64 TESTS 21 249 43520000
255390927 Yk4r2 C April 6, 2024, 10:35 p.m. OK PyPy 3-64 TESTS 21 264 36659200
255366646 OLOGY C April 6, 2024, 6:35 p.m. OK Python 2 TESTS 21 437 18944000
255366681 OLOGY C April 6, 2024, 6:36 p.m. OK Python 2 TESTS 21 452 18944000
255374311 OLOGY C April 6, 2024, 7:36 p.m. OK Python 2 TESTS 21 640 19660800
255374886 OLOGY C April 6, 2024, 7:41 p.m. OK Python 2 TESTS 21 671 19660800
255357096 Adeer_Bakht C April 6, 2024, 5:27 p.m. OK Python 3 TESTS 21 296 36556800
255407915 moondragourav39 C April 7, 2024, 3:31 a.m. OK Python 3 TESTS 21 296 38912000
255354938 Error_Exorcist C April 6, 2024, 5:22 p.m. OK Python 3 TESTS 21 327 36659200
255394372 imwinter C April 6, 2024, 11:33 p.m. OK Python 3 TESTS 21 343 36556800
255354774 Abhigyan09 C April 6, 2024, 5:22 p.m. OK Python 3 TESTS 21 374 36556800
255356384 Campass C April 6, 2024, 5:26 p.m. OK Python 3 TESTS 21 374 38092800
255366276 saikiranreddymekala28 C April 6, 2024, 6:33 p.m. OK Python 3 TESTS 21 405 37990400
255364704 Om_Singh_ C April 6, 2024, 6:24 p.m. OK Python 3 TESTS 21 577 56627200
255359320 bakiddie C April 6, 2024, 5:33 p.m. OK Python 3 TESTS 21 780 53760000
255355078 hk10537 C April 6, 2024, 5:22 p.m. OK Python 3 TESTS 21 921 58163200
255378990 vstiff C April 6, 2024, 8:18 p.m. OK Rust 2021 TESTS 21 77 7475200
255366746 pumpkincheshire C April 6, 2024, 6:36 p.m. OK Rust 2021 TESTS 21 156 30924800

remove filters

Back to search problems