Codeforces Round 1118 (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
2258 Codeforces Round 1118 (Div. 2) FINISHED False 7200 314681 Aug. 29, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 12372 ) B1 Carrot Chopdown (Easy Version) PROGRAMMING brute force math

This is the easy version of the problem. The difference between the versions is that in this version, you only need to solve the problem for (k=1). You can hack only if you solved all versions of this problem. Alp loves carrots. Since he hasn't eaten lunch yet, he wants to buy a carrot salad to eat outside. However, he has a weird obsession: all the carrots must be the exact same length; otherwise, the salad doesn't look aesthetically pleasing to him. Since he is in the middle of the street and doesn't have a knife, he can't cut the carrots himself. You need to divide all the carrots using your machine and sell them to Alp. You are given (n) delicious carrots with sizes (a_1, a_2, \ldots, a_n). You are also given a cutting machine, which works as follows. For each operation, you choose a set of carrots (you can choose chopped carrots again) and a positive integer (x) (not necessarily the same for each operation) . After that, consider every chosen carrot, let its length be (l). If (l \le x), this carrot is unaffected; otherwise, it is divided into two carrots of sizes (x) and (l-x). We'll sell some of the final carrots to an interesting guy who wants them all to be the same length. We are asking you to determine the maximum number of carrots we can sell after using this machine exactly (k) times. Solve the problem for only (k=1). 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 (n) and (m) ((1 \le n,m \le 2 \cdot 10^5)), denoting the number of carrots and the maximum possible length of a carrot. The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le m)), denoting the initial carrot sizes. It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5) and the sum of

Tutorials

Codeforces Round 1118 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
388822867 PlievD B1 Aug. 29, 2026, 4:01 p.m. OK C# 13 TESTS 10 78 27136000
388874194 ask_tanghyy B1 Aug. 30, 2026, 5:45 a.m. OK C++17 (GCC 7-32) TESTS 10 31 5324800
388851236 rishabhgp06 B1 Aug. 29, 2026, 7:10 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
388840670 Shawn_Ge8681 B1 Aug. 29, 2026, 5:32 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
388839877 Bitar B1 Aug. 29, 2026, 5:24 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
388825523 dikshant_w B1 Aug. 29, 2026, 4:09 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
388829018 AdityaAlan B1 Aug. 29, 2026, 4:19 p.m. OK C++17 (GCC 7-32) TESTS 10 46 0
388864877 2noob4u B1 Aug. 30, 2026, 2:01 a.m. OK C++17 (GCC 7-32) TESTS 10 46 0
388848935 Rambo_s B1 Aug. 29, 2026, 6:38 p.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
388849689 utsavp145 B1 Aug. 29, 2026, 6:47 p.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
388844336 kn_prime B1 Aug. 29, 2026, 6:10 p.m. OK C++17 (GCC 7-32) TESTS 10 46 102400
388827342 Zadid B1 Aug. 29, 2026, 4:14 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388872407 Fua B1 Aug. 30, 2026, 5:15 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388871183 kafuyuno B1 Aug. 30, 2026, 4:51 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388868828 kumarabhineet409 B1 Aug. 30, 2026, 3:59 a.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388859947 codertonk B1 Aug. 29, 2026, 10:25 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388837738 xyneex B1 Aug. 29, 2026, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388834450 saloni3494 B1 Aug. 29, 2026, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388832661 eshita6 B1 Aug. 29, 2026, 4:30 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388832244 karanthakur954819 B1 Aug. 29, 2026, 4:29 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388828325 nichebone B1 Aug. 29, 2026, 4:17 p.m. OK C++20 (GCC 13-64) TESTS 10 46 0
388868491 Smallplane B1 Aug. 30, 2026, 3:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 31 2969600
388853875 vishwa149 B1 Aug. 29, 2026, 7:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388870381 cefegent B1 Aug. 30, 2026, 4:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388869503 thisisanshgupta B1 Aug. 30, 2026, 4:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388865080 big-mktx B1 Aug. 30, 2026, 2:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388863146 yunyue66 B1 Aug. 30, 2026, 12:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388860189 mayank1075.mahajan B1 Aug. 29, 2026, 10:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388859025 Snowdust B1 Aug. 29, 2026, 9:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388855645 drazehuh B1 Aug. 29, 2026, 8:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388852595 jackylova_fan_fan_fan B1 Aug. 29, 2026, 7:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
388825660 milahr B1 Aug. 29, 2026, 4:09 p.m. OK C# 8 TESTS 10 109 17305600
388833793 sibanandsahu38 B1 Aug. 29, 2026, 4:33 p.m. OK GNU C11 TESTS 10 46 819200
388828987 Newbie_Coder-1101 B1 Aug. 29, 2026, 4:19 p.m. OK GNU C11 TESTS 10 46 1536000
388822572 _dr.doom_ B1 Aug. 29, 2026, 4 p.m. OK GNU C11 TESTS 10 46 1536000
388860912 Maliyat B1 Aug. 29, 2026, 11:04 p.m. OK GNU C11 TESTS 10 46 1638400
388845549 SawK13 B1 Aug. 29, 2026, 6:23 p.m. OK GNU C11 TESTS 10 46 1638400
388837409 sandbad B1 Aug. 29, 2026, 5 p.m. OK GNU C11 TESTS 10 46 2457600
388820725 ragibibu420 B1 Aug. 29, 2026, 3:55 p.m. OK GNU C11 TESTS 10 46 2457600
388826984 lite_only B1 Aug. 29, 2026, 4:13 p.m. OK GNU C11 TESTS 10 62 921600
388834542 SilverWolfes B1 Aug. 29, 2026, 4:34 p.m. OK GNU C11 TESTS 10 62 1433600
388836595 m_husssain B1 Aug. 29, 2026, 4:53 p.m. OK GNU C11 TESTS 10 62 1536000
388822305 Sparta_ B1 Aug. 29, 2026, 4 p.m. OK Go TESTS 10 140 5836800
388831404 treasuryonly B1 Aug. 29, 2026, 4:26 p.m. OK Haskell TESTS 10 765 68300800
388829067 flyinggit B1 Aug. 29, 2026, 4:19 p.m. OK Haskell TESTS 10 953 69222400
388874420 NooB__C0der B1 Aug. 30, 2026, 5:49 a.m. OK Java 21 TESTS 10 171 1638400
388827849 Ayush_Mourya28 B1 Aug. 29, 2026, 4:16 p.m. OK Java 21 TESTS 10 187 409600
388829875 prvndnkhr B1 Aug. 29, 2026, 4:22 p.m. OK Java 21 TESTS 10 187 614400
388873508 biplav B1 Aug. 30, 2026, 5:33 a.m. OK Java 21 TESTS 10 203 409600
388822614 krishanbhadala99 B1 Aug. 29, 2026, 4:01 p.m. OK Java 21 TESTS 10 203 716800
388834128 PawanKumarMishra B1 Aug. 29, 2026, 4:33 p.m. OK Java 21 TESTS 10 203 1228800
388820743 Priyanka_1312 B1 Aug. 29, 2026, 3:55 p.m. OK Java 21 TESTS 10 203 1228800
388828139 Jeffy11 B1 Aug. 29, 2026, 4:17 p.m. OK Java 21 TESTS 10 218 0
388864944 aniketHacker B1 Aug. 30, 2026, 2:03 a.m. OK Java 21 TESTS 10 218 307200
388819997 shikhar156 B1 Aug. 29, 2026, 3:53 p.m. OK Java 21 TESTS 10 218 512000
388840178 Basharath_S B1 Aug. 29, 2026, 5:27 p.m. OK Java 8 TESTS 10 109 0
388825434 Mystic_Maverick B1 Aug. 29, 2026, 4:09 p.m. OK Java 8 TESTS 10 109 0
388864043 nidarshana B1 Aug. 30, 2026, 1:29 a.m. OK Java 8 TESTS 10 125 2560000
388821666 riyazkha2004 B1 Aug. 29, 2026, 3:58 p.m. OK Java 8 TESTS 10 140 2560000
388823051 akarui.aryan B1 Aug. 29, 2026, 4:02 p.m. OK Java 8 TESTS 10 156 2560000
388828974 Rajbir_singh B1 Aug. 29, 2026, 4:19 p.m. OK Java 8 TESTS 10 343 0
388830404 nadirburri B1 Aug. 29, 2026, 4:23 p.m. OK Java 8 TESTS 10 359 0
388828816 AlbertWesker B1 Aug. 29, 2026, 4:19 p.m. OK Java 8 TESTS 10 375 0
388825971 sivaganeshrayalch B1 Aug. 29, 2026, 4:10 p.m. OK Java 8 TESTS 10 375 0
388821453 psukhmeet B1 Aug. 29, 2026, 3:57 p.m. OK Java 8 TESTS 10 390 0
388826857 KhadijahA B1 Aug. 29, 2026, 4:13 p.m. OK Kotlin 1.9 TESTS 10 218 13721600
388825602 isatoyin B1 Aug. 29, 2026, 4:09 p.m. OK Kotlin 2.2 TESTS 10 140 3481600
388851000 dannieko02 B1 Aug. 29, 2026, 7:06 p.m. OK PyPy 3 TESTS 10 93 15155200
388822025 cc.jones B1 Aug. 29, 2026, 3:59 p.m. OK PyPy 3 TESTS 10 109 11673600
388822298 venkat2004 B1 Aug. 29, 2026, 4 p.m. OK PyPy 3 TESTS 10 109 11980800
388822504 rahulgk2009 B1 Aug. 29, 2026, 4 p.m. OK PyPy 3 TESTS 10 125 12697600
388821871 Saketh_Srivathsa09 B1 Aug. 29, 2026, 3:58 p.m. OK PyPy 3 TESTS 10 250 18329600
388852923 Sami2525 B1 Aug. 29, 2026, 7:37 p.m. OK PyPy 3 TESTS 10 265 14233600
388844231 SameerAnsari B1 Aug. 29, 2026, 6:09 p.m. OK PyPy 3 TESTS 10 265 16384000
388819844 Viveksarathe B1 Aug. 29, 2026, 3:52 p.m. OK PyPy 3 TESTS 10 328 14131200
388850167 Mandeep234 B1 Aug. 29, 2026, 6:54 p.m. OK PyPy 3 TESTS 10 359 14745600
388838169 adis1729 B1 Aug. 29, 2026, 5:07 p.m. OK PyPy 3 TESTS 10 453 13516800
388828392 vaibhav331 B1 Aug. 29, 2026, 4:18 p.m. OK PyPy 3-64 TESTS 10 93 19558400
388824392 nickindian07 B1 Aug. 29, 2026, 4:06 p.m. OK PyPy 3-64 TESTS 10 93 19558400
388872678 GatikSolanki13 B1 Aug. 30, 2026, 5:19 a.m. OK PyPy 3-64 TESTS 10 93 20582400
388824133 clayzanePy B1 Aug. 29, 2026, 4:05 p.m. OK PyPy 3-64 TESTS 10 93 20582400
388822238 sumedhaghoshh007 B1 Aug. 29, 2026, 3:59 p.m. OK PyPy 3-64 TESTS 10 93 20684800
388872723 Jiangjiapei B1 Aug. 30, 2026, 5:20 a.m. OK PyPy 3-64 TESTS 10 93 25292800
388829783 artemisia_gr B1 Aug. 29, 2026, 4:22 p.m. OK PyPy 3-64 TESTS 10 93 25600000
388831426 NIV_RAM B1 Aug. 29, 2026, 4:26 p.m. OK PyPy 3-64 TESTS 10 109 20787200
388851307 L-Near B1 Aug. 29, 2026, 7:12 p.m. OK PyPy 3-64 TESTS 10 109 22016000
388832594 maxleung21 B1 Aug. 29, 2026, 4:30 p.m. OK PyPy 3-64 TESTS 10 109 22016000
388821461 jsemag B1 Aug. 29, 2026, 3:57 p.m. OK Python 3 TESTS 10 109 14643200
388857517 ananyavajpayee0904 B1 Aug. 29, 2026, 9:09 p.m. OK Python 3 TESTS 10 125 14028800
388834453 divbyzero B1 Aug. 29, 2026, 4:34 p.m. OK Python 3 TESTS 10 125 21094400
388850500 manojgonuguntla.work B1 Aug. 29, 2026, 6:59 p.m. OK Python 3 TESTS 10 125 21196800
388825875 Snthosh B1 Aug. 29, 2026, 4:10 p.m. OK Python 3 TESTS 10 125 21196800
388820458 gadhwalvipin12 B1 Aug. 29, 2026, 3:54 p.m. OK Python 3 TESTS 10 125 23040000
388865499 gagan2712 B1 Aug. 30, 2026, 2:25 a.m. OK Python 3 TESTS 10 125 23347200
388834152 RashNuke B1 Aug. 29, 2026, 4:33 p.m. OK Python 3 TESTS 10 140 20992000
388849826 shikazu B1 Aug. 29, 2026, 6:49 p.m. OK Python 3 TESTS 10 140 21094400
388832314 kit28.24bcs031 B1 Aug. 29, 2026, 4:29 p.m. OK Python 3 TESTS 10 140 21196800
388851567 cheikhghadi5 B1 Aug. 29, 2026, 7:16 p.m. OK Rust 2021 TESTS 10 46 5632000
388820175 samyakuza B1 Aug. 29, 2026, 3:53 p.m. OK Rust 2024 TESTS 10 62 3174400

remove filters

Back to search problems