Codeforces Round 797 (Div. 3)

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
1690 Codeforces Round 797 (Div. 3) FINISHED False 8100 77210699 June 7, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15330 ) E Price Maximization PROGRAMMING binary search greedy math two pointers 1500

B"A batch of n goods ( n -- an even number) is brought to the store, i -th of which has weight a_i . Before selling the goods, they must be packed into packages. After packing, the following will be done: With this, the cost of a package of weight x is always <= ft lfloor frac{x}{k} right rfloor burles (rounded down), where k -- a fixed and given value. Pack the goods to the packages so that the revenue from their sale is maximized. In other words, make such frac{n}{2} pairs of given goods that the sum of the values <= ft lfloor frac{x_i}{k} right rfloor , where x_i is the weight of the package number i ( 1 <= i <= frac{n}{2} ), is maximal. For example, let n = 6, k = 3 , weights of goods a = [3, 2, 7, 1, 4, 8] . Let's pack them into the following packages. With this packing, the total cost of all packs would be 5 + 2 + 1 = 8 burles. The first line of the input contains an integer t ( 1 <= t <= 10^4 ) --the number of test cases in the test. The descriptions of the test cases follow. The first line of each test case contains two integers n ( 2 <= n <= 2 cdot10^5 ) and k ( 1 <= k <= 1000 ). The number n -- is even. The second line of each test case contains exactly n integers a_1, a_2, ... , a_n ( 0 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all the test cases does not exceed 2 cdot10^5 . For each test case, print on a separate line a single number -- the maximum possible total cost of all the packages. The first test case is analyzed in the statement. In the second test case, you can get a total value equal to 4 if you put the first and second goods in the first package and the third and fourth goods in the second package. In the third test case, the cost of each item is 0 , so the total cost will also be 0 . "...

Tutorials

Codeforces Round #797 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
159906252 tabibi E June 8, 2022, 6:33 a.m. OK C# 10 TESTS 104 233 15872000 1500
159979228 bluemegane E June 9, 2022, 1:27 a.m. OK C# 8 TESTS 104 156 18636800 1500
159979292 bluemegane E June 9, 2022, 1:30 a.m. OK C# 8 TESTS 104 171 18636800 1500
159978942 bluemegane E June 9, 2022, 1:18 a.m. OK C# 8 TESTS 104 233 18636800 1500
159946798 allegrogiken E June 8, 2022, 2:24 p.m. OK D TESTS 104 171 24268800 1500
159976861 lkhanh E June 8, 2022, 11:43 p.m. OK GNU C++14 TESTS 104 77 819200 1500
159923124 KAIXING E June 8, 2022, 9:55 a.m. OK GNU C++14 TESTS 104 77 819200 1500
159979775 ray-Kun E June 9, 2022, 1:48 a.m. OK GNU C++14 TESTS 104 78 819200 1500
159926704 2018339901318 E June 8, 2022, 10:38 a.m. OK GNU C++14 TESTS 104 78 1638400 1500
159946680 bijalwan_2000 E June 8, 2022, 2:23 p.m. OK GNU C++14 TESTS 104 78 3174400 1500
159917195 MidnightKinG E June 8, 2022, 8:52 a.m. OK GNU C++14 TESTS 104 78 3993600 1500
159984644 Essa2006 E June 9, 2022, 4:12 a.m. OK GNU C++14 TESTS 104 93 819200 1500
159980269 A_fei E June 9, 2022, 2:05 a.m. OK GNU C++14 TESTS 104 93 819200 1500
159974497 krunal_078 E June 8, 2022, 9:55 p.m. OK GNU C++14 TESTS 104 93 819200 1500
159957857 ishwarchand9312 E June 8, 2022, 4:52 p.m. OK GNU C++14 TESTS 104 93 819200 1500
159926752 baizhiyue E June 8, 2022, 10:39 a.m. OK GNU C++17 TESTS 104 77 1638400 1500
159921071 codefresher E June 8, 2022, 9:33 a.m. OK GNU C++17 TESTS 104 77 1638400 1500
159954159 DUMMY_S E June 8, 2022, 4:02 p.m. OK GNU C++17 TESTS 104 77 1843200 1500
159981702 GuAn666 E June 9, 2022, 2:54 a.m. OK GNU C++17 TESTS 104 78 819200 1500
159960290 Rahul139 E June 8, 2022, 5:23 p.m. OK GNU C++17 TESTS 104 78 819200 1500
159935443 Pety E June 8, 2022, 12:17 p.m. OK GNU C++17 TESTS 104 78 819200 1500
159930830 zkker E June 8, 2022, 11:26 a.m. OK GNU C++17 TESTS 104 78 819200 1500
159919039 the___reaper E June 8, 2022, 9:11 a.m. OK GNU C++17 TESTS 104 78 819200 1500
159910517 wifiiii E June 8, 2022, 7:21 a.m. OK GNU C++17 TESTS 104 78 819200 1500
159965624 S4LA E June 8, 2022, 6:33 p.m. OK GNU C++17 TESTS 104 78 1638400 1500
159904114 Sakib62 E June 8, 2022, 6:07 a.m. OK GNU C++17 (64) TESTS 104 46 1638400 1500
159985702 Abhi_sahu E June 9, 2022, 4:40 a.m. OK GNU C++17 (64) TESTS 104 46 3174400 1500
159968742 amans07 E June 8, 2022, 7:26 p.m. OK GNU C++17 (64) TESTS 104 61 819200 1500
159965138 _mikasa E June 8, 2022, 6:27 p.m. OK GNU C++17 (64) TESTS 104 61 1638400 1500
159960328 Kenshin2438 E June 8, 2022, 5:23 p.m. OK GNU C++17 (64) TESTS 104 61 1638400 1500
159982615 thu_lecore E June 9, 2022, 3:19 a.m. OK GNU C++17 (64) TESTS 104 62 819200 1500
159980514 thu_lecore E June 9, 2022, 2:15 a.m. OK GNU C++17 (64) TESTS 104 62 819200 1500
159954539 euler1729 E June 8, 2022, 4:07 p.m. OK GNU C++17 (64) TESTS 104 62 819200 1500
159952685 mbdbr E June 8, 2022, 3:44 p.m. OK GNU C++17 (64) TESTS 104 62 819200 1500
159919624 Lycoriss E June 8, 2022, 9:17 a.m. OK GNU C++17 (64) TESTS 104 62 819200 1500
159935417 ihydra1611 E June 8, 2022, 12:16 p.m. OK GNU C++20 (64) TESTS 104 46 307200 1500
159984315 jjo_ayt E June 9, 2022, 4:04 a.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159983329 jasonray0328 E June 9, 2022, 3:38 a.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159983171 chenshengyi E June 9, 2022, 3:34 a.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159979614 sasi_rebel E June 9, 2022, 1:42 a.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159968082 madhav_bhatia E June 8, 2022, 7:13 p.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159965595 Ghieath E June 8, 2022, 6:33 p.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159965459 Lextyle E June 8, 2022, 6:31 p.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159959707 mdbrnowski E June 8, 2022, 5:16 p.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159958617 Menos E June 8, 2022, 5:03 p.m. OK GNU C++20 (64) TESTS 104 46 819200 1500
159923859 weiweiwei_ E June 8, 2022, 10:04 a.m. OK Java 11 TESTS 104 233 0 1500
159923187 _alpaca E June 8, 2022, 9:56 a.m. OK Java 11 TESTS 104 234 0 1500
159982493 gaurav_g E June 9, 2022, 3:16 a.m. OK Java 11 TESTS 104 264 102400 1500
159927718 nbhakar E June 8, 2022, 10:51 a.m. OK Java 11 TESTS 104 295 0 1500
159987017 JigarNainuji E June 9, 2022, 5:08 a.m. OK Java 11 TESTS 104 296 0 1500
159909583 msarthak E June 8, 2022, 7:10 a.m. OK Java 11 TESTS 104 296 0 1500
159907037 aditya2024 E June 8, 2022, 6:42 a.m. OK Java 11 TESTS 104 296 0 1500
159961280 vamshisamineni3 E June 8, 2022, 5:35 p.m. OK Java 11 TESTS 104 296 11673600 1500
159974727 dinosparton_013 E June 8, 2022, 10:04 p.m. OK Java 11 TESTS 104 311 0 1500
159917806 aayush_gakhar E June 8, 2022, 8:58 a.m. OK Java 11 TESTS 104 311 0 1500
159980823 oneafter E June 9, 2022, 2:26 a.m. OK Java 8 TESTS 104 155 3072000 1500
159910281 P_Key26dec E June 8, 2022, 7:19 a.m. OK Java 8 TESTS 104 171 18124800 1500
159969588 CrinklyGolem E June 8, 2022, 7:43 p.m. OK Java 8 TESTS 104 186 4096000 1500
159935587 moyan_01 E June 8, 2022, 12:18 p.m. OK Java 8 TESTS 104 186 18227200 1500
159925243 swarup_312 E June 8, 2022, 10:20 a.m. OK Java 8 TESTS 104 202 0 1500
159907464 aryaman_571 E June 8, 2022, 6:46 a.m. OK Java 8 TESTS 104 202 2764800 1500
159907208 aryaman_571 E June 8, 2022, 6:44 a.m. OK Java 8 TESTS 104 202 2764800 1500
159959861 faild-in-2021 E June 8, 2022, 5:17 p.m. OK Java 8 TESTS 104 218 0 1500
159955109 alv1 E June 8, 2022, 4:15 p.m. OK Java 8 TESTS 104 218 3072000 1500
159934648 pranayrana14 E June 8, 2022, 12:07 p.m. OK Java 8 TESTS 104 233 3072000 1500
159956320 LeoPro E June 8, 2022, 4:31 p.m. OK Kotlin 1.5 TESTS 104 467 19251200 1500
159959114 nitish420 E June 8, 2022, 5:09 p.m. OK Kotlin 1.6 TESTS 104 1138 17305600 1500
159960502 ktropin E June 8, 2022, 5:26 p.m. OK Mono C# TESTS 104 202 28876800 1500
159926767 AlexeyT E June 8, 2022, 10:39 a.m. OK MS C++ 2017 TESTS 104 265 819200 1500
159925283 Gabella E June 8, 2022, 10:20 a.m. OK MS C++ 2017 TESTS 104 265 1638400 1500
159904012 Mad112233 E June 8, 2022, 6:06 a.m. OK MS C++ 2017 TESTS 104 280 1638400 1500
159960916 Bu1izhnik E June 8, 2022, 5:30 p.m. OK MS C++ 2017 TESTS 104 280 1638400 1500
159962922 BusIgor E June 8, 2022, 5:56 p.m. OK MS C++ 2017 TESTS 104 904 4812800 1500
159937894 Pigeon. E June 8, 2022, 12:44 p.m. OK MS C++ 2017 TESTS 104 1933 4915200 1500
159937841 Pigeon. E June 8, 2022, 12:44 p.m. OK MS C++ 2017 TESTS 104 1934 4812800 1500
159906420 xuhao95 E June 8, 2022, 6:35 a.m. OK PyPy 3 TESTS 104 202 19558400 1500
159963391 abhishekk_7 E June 8, 2022, 6:03 p.m. OK PyPy 3 TESTS 104 327 19660800 1500
159938318 YMSeah E June 8, 2022, 12:49 p.m. OK PyPy 3 TESTS 104 342 20480000 1500
159958701 kwin E June 8, 2022, 5:03 p.m. OK PyPy 3 TESTS 104 389 15360000 1500
159955966 pranay_28 E June 8, 2022, 4:27 p.m. OK PyPy 3 TESTS 104 420 15257600 1500
159958954 tcltk E June 8, 2022, 5:07 p.m. OK PyPy 3 TESTS 104 483 20275200 1500
159915145 szel393 E June 8, 2022, 8:30 a.m. OK PyPy 3 TESTS 104 514 19251200 1500
159923953 Apoorv_Rathore E June 8, 2022, 10:05 a.m. OK PyPy 3 TESTS 104 530 19148800 1500
159905591 ayushgupta71011 E June 8, 2022, 6:26 a.m. OK PyPy 3 TESTS 104 701 21401600 1500
159915667 Shaydiesin E June 8, 2022, 8:35 a.m. OK PyPy 3 TESTS 104 1045 19148800 1500
159928209 kboi E June 8, 2022, 10:56 a.m. OK PyPy 3-64 TESTS 104 140 28876800 1500
159938899 Soumik43 E June 8, 2022, 12:55 p.m. OK PyPy 3-64 TESTS 104 155 28262400 1500
159910750 tushar26427 E June 8, 2022, 7:24 a.m. OK PyPy 3-64 TESTS 104 249 32460800 1500
159951064 iron_nicko E June 8, 2022, 3:23 p.m. OK PyPy 3-64 TESTS 104 280 22528000 1500
159923034 abhijeet.panihar.cse20 E June 8, 2022, 9:54 a.m. OK PyPy 3-64 TESTS 104 280 29286400 1500
159930500 coder_sounak E June 8, 2022, 11:22 a.m. OK PyPy 3-64 TESTS 104 296 41369600 1500
159915584 Anti-Neutrino E June 8, 2022, 8:34 a.m. OK PyPy 3-64 TESTS 104 311 28364800 1500
159981897 MistaAsh E June 9, 2022, 2:59 a.m. OK PyPy 3-64 TESTS 104 327 28364800 1500
159923409 abhaumik24 E June 8, 2022, 9:58 a.m. OK PyPy 3-64 TESTS 104 342 32768000 1500
159908478 hardik2001 E June 8, 2022, 6:58 a.m. OK PyPy 3-64 TESTS 104 358 29798400 1500
159904345 deepansh09 E June 8, 2022, 6:10 a.m. OK Python 3 TESTS 104 296 16486400 1500
159960879 divyamkakkar24 E June 8, 2022, 5:30 p.m. OK Python 3 TESTS 104 311 16793600 1500
159934099 bbfish E June 8, 2022, 12:01 p.m. OK Python 3 TESTS 104 312 16486400 1500
159936699 bbfish E June 8, 2022, 12:31 p.m. OK Python 3 TESTS 104 327 14540800 1500
159936185 bbfish E June 8, 2022, 12:25 p.m. OK Python 3 TESTS 104 327 14540800 1500
159937463 Ayush_ag E June 8, 2022, 12:40 p.m. OK Python 3 TESTS 104 327 16486400 1500
159934902 bbfish E June 8, 2022, 12:10 p.m. OK Python 3 TESTS 104 327 16486400 1500
159933962 bbfish E June 8, 2022, 11:59 a.m. OK Python 3 TESTS 104 327 16486400 1500
159935753 bbfish E June 8, 2022, 12:20 p.m. OK Python 3 TESTS 104 327 18432000 1500
159936592 bbfish E June 8, 2022, 12:29 p.m. OK Python 3 TESTS 104 343 14540800 1500

remove filters

Back to search problems