Codeforces Round 1033 (Div. 2) and CodeNite 2025

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
2120 Codeforces Round 1033 (Div. 2) and CodeNite 2025 FINISHED False 7200 25889123 June 21, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1832 ) E Lanes of Cars PROGRAMMING binary search dp ternary search

Harshith is the president of TollClub. He tasks his subordinate Aryan to oversee a toll plaza with (n) lanes. Initially, the (i)-th lane has (a_i) cars waiting in a queue. Exactly one car from the front of each lane passes through the toll every second. The angriness of a car is defined as the number of seconds it had to wait before passing through the toll. Consider it takes 1 sec for each car to pass the toll, i.e., the first car in a lane has angriness (1), the second car has angriness (2), and so on. To reduce congestion and frustration, cars are allowed to switch lanes. A car can instantly move to the back of any other lane at any time. However, changing lanes increases its angriness by an additional (k) units due to the confusion caused by the lane change. Harshith, being the awesome person he is, wants to help the drivers by minimising the total angriness of all cars. He asks Aryan to do so or get fired. Aryan is allowed to change lanes of any car anytime (possibly zero), but his goal is to find the minimum possible total angriness if the lane changes are done optimally. Help Aryan retain his job by determining the minimum angriness he can achieve. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1 \le n \le 2 \cdot 10^5), (1 \le k \le 10^6)) — the number of lanes and the increment in angriness on a lane change. The second line of each test case contains (n) space-separated integers, denoting array (a) — the (i)-th number representing the number of cars in the (i)-th lane ((1 \le a_i \le 10^6)). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). Note that the sum of (\max a_i) over all test cases is not bounded. For each test case, output a single integer in

Tutorials

Codeforces Round 1033 (Div. 2) and CodeNite 2025 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
325485216 og.kostya E June 21, 2025, 5:16 p.m. OK C# 10 TESTS 49 156 22835200
325484671 og.kostya E June 21, 2025, 5:13 p.m. OK C# 13 TESTS 49 327 20684800
325481692 mban259 E June 21, 2025, 4:34 p.m. OK C# 13 TESTS 49 1889 40550400
325493442 DylanT E June 21, 2025, 6:18 p.m. OK C++17 (GCC 7-32) TESTS 49 124 1126400
325473317 nikita15 E June 21, 2025, 4:15 p.m. OK C++17 (GCC 7-32) TESTS 49 124 1126400
325470089 niveee E June 21, 2025, 4:07 p.m. OK C++17 (GCC 7-32) TESTS 49 124 1126400
325480862 ankit37saha E June 21, 2025, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 49 125 102400
325473152 myee E June 21, 2025, 4:14 p.m. OK C++17 (GCC 7-32) TESTS 49 140 0
325492150 man_of_learning E June 21, 2025, 6:06 p.m. OK C++17 (GCC 7-32) TESTS 49 140 0
325480371 AyushWani E June 21, 2025, 4:32 p.m. OK C++17 (GCC 7-32) TESTS 49 140 0
325474036 Algoquasar E June 21, 2025, 4:16 p.m. OK C++17 (GCC 7-32) TESTS 49 140 0
325467486 Lakshay_rao E June 21, 2025, 4:01 p.m. OK C++17 (GCC 7-32) TESTS 49 140 0
325480792 goyallbhavy E June 21, 2025, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 49 140 102400
325501130 ee22b163 E June 22, 2025, 2:58 a.m. OK C++20 (GCC 13-64) TESTS 49 78 102400
325494698 ankitraj803119 E June 21, 2025, 6:30 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325503142 problem10programming E June 22, 2025, 3:36 a.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325496979 fengxiabcd E June 22, 2025, 1:36 a.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325494867 beiyuli E June 21, 2025, 6:32 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325491696 bh23 E June 21, 2025, 6:02 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325485613 tong_qi E June 21, 2025, 5:18 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325481491 nikhilvishwakarma9775_ E June 21, 2025, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325481388 undercat E June 21, 2025, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325481331 tharun E June 21, 2025, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 49 93 102400
325468770 Kiffaz E June 21, 2025, 4:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325508398 Soumil69 E June 22, 2025, 5:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325501962 za0271497 E June 22, 2025, 3:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325496996 MinhQuangCVP E June 22, 2025, 1:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325481382 paneerparatha E June 21, 2025, 4:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325481370 dangiyatharth9 E June 21, 2025, 4:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325476452 nger8028 E June 21, 2025, 4:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325472571 divyesh23 E June 21, 2025, 4:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 102400
325497757 B_3 E June 22, 2025, 2:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 1228800
325479946 Thorfinn10 E June 21, 2025, 4:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 93 1331200
325473563 James_bond_9089 E June 21, 2025, 4:15 p.m. OK C# 8 TESTS 49 203 16691200
325497546 rainboy E June 22, 2025, 1:57 a.m. OK GNU C11 TESTS 49 140 1638400
325479746 pengin_2000 E June 21, 2025, 4:31 p.m. OK GNU C11 TESTS 49 140 6451200
325468500 KrishSingla14 E June 21, 2025, 4:03 p.m. OK Go TESTS 49 155 4096000
325478831 mimicLIV E June 21, 2025, 4:29 p.m. OK Go TESTS 49 1218 5427200
325472529 mridulpathania05 E June 21, 2025, 4:12 p.m. OK Go TESTS 49 1358 7270400
325475137 uber_calm_18 E June 21, 2025, 4:19 p.m. OK Java 21 TESTS 49 327 819200
325470961 The_Bharadwaj E June 21, 2025, 4:09 p.m. OK Java 21 TESTS 49 374 1228800
325478393 PraachiRasane E June 21, 2025, 4:28 p.m. OK Java 21 TESTS 49 405 2150400
325477089 fostercox909 E June 21, 2025, 4:24 p.m. OK Java 21 TESTS 49 421 716800
325476842 iamalizaidi E June 21, 2025, 4:24 p.m. OK Java 21 TESTS 49 421 819200
325480699 Venom_cf E June 21, 2025, 4:33 p.m. OK Java 21 TESTS 49 452 3072000
325498436 sahasrad E June 22, 2025, 2:16 a.m. OK Java 21 TESTS 49 499 1024000
325474597 MdAswath E June 21, 2025, 4:18 p.m. OK Java 21 TESTS 49 687 1228800
325470116 ppmishra2411 E June 21, 2025, 4:07 p.m. OK Java 21 TESTS 49 702 1843200
325478871 abhay004 E June 21, 2025, 4:29 p.m. OK Java 21 TESTS 49 733 1433600
325478526 abhijeet29102004 E June 21, 2025, 4:28 p.m. OK Java 8 TESTS 49 218 3993600
325478918 NischayCodes E June 21, 2025, 4:29 p.m. OK Java 8 TESTS 49 249 3993600
325465984 omdeshmukh1906 E June 21, 2025, 3:56 p.m. OK Java 8 TESTS 49 921 39833600
325470755 ag5356 E June 21, 2025, 4:08 p.m. OK PyPy 3 TESTS 49 843 15564800
325467649 Cybuster E June 21, 2025, 4:01 p.m. OK PyPy 3 TESTS 49 1765 66048000
325481366 rocker2801 E June 21, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 49 249 25600000
325477250 hxu10 E June 21, 2025, 4:25 p.m. OK PyPy 3-64 TESTS 49 264 26726400
325481449 sukhbir0609 E June 21, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 49 265 25600000
325495113 Skyblock127 E June 21, 2025, 6:35 p.m. OK PyPy 3-64 TESTS 49 265 26419200
325472002 HARSHdeep1234 E June 21, 2025, 4:11 p.m. OK PyPy 3-64 TESTS 49 280 25907200
325472910 C-3155 E June 21, 2025, 4:13 p.m. OK PyPy 3-64 TESTS 49 281 27443200
325476932 gursimarsinghmiglani E June 21, 2025, 4:24 p.m. OK PyPy 3-64 TESTS 49 296 25497600
325504556 harshitgrover007 E June 22, 2025, 3:59 a.m. OK PyPy 3-64 TESTS 49 296 26521600
325473099 tranlehieu E June 21, 2025, 4:14 p.m. OK PyPy 3-64 TESTS 49 296 26624000
325471559 C-34 E June 21, 2025, 4:10 p.m. OK PyPy 3-64 TESTS 49 296 27238400
325490716 AgiKAdevta E June 21, 2025, 5:54 p.m. OK Python 3 TESTS 49 436 53760000
325478581 aaronhartono28 E June 21, 2025, 4:28 p.m. OK Python 3 TESTS 49 452 34201600
325481258 SaiSridhar783 E June 21, 2025, 4:34 p.m. OK Python 3 TESTS 49 484 33894400
325467905 phylum E June 21, 2025, 4:02 p.m. OK Python 3 TESTS 49 702 24985600
325478806 Mohan_.12 E June 21, 2025, 4:29 p.m. OK Python 3 TESTS 49 890 25088000
325474227 ayushdreams147 E June 21, 2025, 4:17 p.m. OK Python 3 TESTS 49 921 23859200
325472478 prof123cpp E June 21, 2025, 4:12 p.m. OK Python 3 TESTS 49 968 24064000
325481756 J...B E June 21, 2025, 4:34 p.m. OK Python 3 TESTS 49 1046 23347200
325468603 asimsuhail42 E June 21, 2025, 4:03 p.m. OK Python 3 TESTS 49 1046 23654400
325472951 anshvarma16 E June 21, 2025, 4:14 p.m. OK Python 3 TESTS 49 1062 22016000
325474077 blackpanther_7 E June 21, 2025, 4:16 p.m. OK Rust 2021 TESTS 49 124 5734400

remove filters

Back to search problems