Codeforces Round 936 (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
1946 Codeforces Round 936 (Div. 2) FINISHED False 7200 20705099 March 22, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 26122 ) A Median of an Array PROGRAMMING greedy implementation

B'You are given an array a of n integers. The median of an array q_1, q_2, ldots, q_k is the number p_{ lceil frac{k}{2} rceil} , where p is the array q sorted in non-decreasing order. For example, the median of the array [9, 5, 1, 2, 6] is 5 , as in the sorted array [1, 2, 5, 6, 9] , the number at index lceil frac{5}{2} rceil = 3 is 5 , and the median of the array [9, 2, 8, 3] is 3 , as in the sorted array [2, 3, 8, 9] , the number at index lceil frac{4}{2} rceil = 2 is 3 . You are allowed to choose an integer i ( 1 <= i <= n ) and increase a_i by 1 in one operation. Your task is to find the minimum number of operations required to increase the median of the array. Note that the array a may not necessarily contain distinct numbers. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then follows the description of the test cases. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the array a . It is guaranteed that the sum of the values of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the minimum number of operations required to increase the median of the array. In the first test case, you can apply one operation to the first number and obtain the array [3, 2, 8] , the median of this array is 3 , as it is the number at index lceil frac{3}{2} rceil = 2 in the non-decreasing sorted array [2, 3, 8] . The median of the original array [2, 2, 8] is 2 , as it is the number at index lceil frac{3}{2} rceil = 2 in the non-decreasing sorte'...

Tutorials

Codeforces Round #936 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
252851395 chrisTris A March 23, 2024, 2:08 a.m. OK C# 10 TESTS 8 92 19148800
252827406 Arnyev A March 22, 2024, 7:47 p.m. OK C# 10 TESTS 7 93 19148800
252819359 Shazidhstu20 A March 22, 2024, 6:26 p.m. OK C# 10 TESTS 7 93 19865600
252848261 karamkontar A March 23, 2024, 1:06 a.m. OK C# 10 TESTS 8 93 23244800
252857490 master_procastinator A March 23, 2024, 3:33 a.m. OK C++14 (GCC 6-32) TESTS 8 46 409600
252817343 __AhmedSamir__ A March 22, 2024, 6:08 p.m. OK C++14 (GCC 6-32) TESTS 7 46 409600
252810811 2022mcb1269 A March 22, 2024, 5:23 p.m. OK C++14 (GCC 6-32) TESTS 6 46 819200
252822861 priyanshu_pandey_core A March 22, 2024, 7 p.m. OK C++14 (GCC 6-32) TESTS 7 61 1126400
252862040 vattsssDev A March 23, 2024, 4:36 a.m. OK C++14 (GCC 6-32) TESTS 8 61 4403200
252861841 Ruang_Feng A March 23, 2024, 4:33 a.m. OK C++14 (GCC 6-32) TESTS 8 62 409600
252867520 peymar A March 23, 2024, 5:34 a.m. OK C++14 (GCC 6-32) TESTS 8 62 409600
252866932 MitakeMoca A March 23, 2024, 5:29 a.m. OK C++14 (GCC 6-32) TESTS 8 62 409600
252865969 V1giLanT A March 23, 2024, 5:22 a.m. OK C++14 (GCC 6-32) TESTS 8 62 409600
252863267 Ruang_Feng A March 23, 2024, 4:52 a.m. OK C++14 (GCC 6-32) TESTS 8 62 409600
252850695 wooooow A March 23, 2024, 1:56 a.m. OK C++17 (GCC 7-32) TESTS 8 31 409600
252856561 huopy01 A March 23, 2024, 3:22 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252869020 e-bld_bestshot.sk A March 23, 2024, 5:46 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252866190 NexTopper A March 23, 2024, 5:24 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252865865 Bshuvo A March 23, 2024, 5:20 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252865291 sajal_garg_300 A March 23, 2024, 5:15 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252864027 RaghadMusleh A March 23, 2024, 5:02 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252862141 Jashwanth2711 A March 23, 2024, 4:37 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252861259 krishparikh05102004 A March 23, 2024, 4:25 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252859051 kimnattanan A March 23, 2024, 3:53 a.m. OK C++17 (GCC 7-32) TESTS 8 46 409600
252848428 Kiffaz A March 23, 2024, 1:10 a.m. OK C++20 (GCC 13-64) TESTS 8 15 716800
252846115 Leveraime A March 23, 2024, 12:20 a.m. OK C++20 (GCC 13-64) TESTS 8 30 409600
252842747 Isa_m A March 22, 2024, 11:11 p.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252870055 Lu_Kai A March 23, 2024, 5:54 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252869134 hbkxyz A March 23, 2024, 5:47 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252864952 The__Curse A March 23, 2024, 5:12 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252861981 Wt_vic A March 23, 2024, 4:35 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252855106 b_AHA_r A March 23, 2024, 3:04 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252853677 PurpleCrayon A March 23, 2024, 2:42 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252853618 Chentxo A March 23, 2024, 2:41 a.m. OK C++20 (GCC 13-64) TESTS 8 31 409600
252838726 bluemegane A March 22, 2024, 9:59 p.m. OK C# 8 TESTS 8 139 19558400
252801463 Keerthana67 A March 22, 2024, 4:21 p.m. OK GNU C11 TESTS 6 46 409600
252801180 eggincheese A March 22, 2024, 4:21 p.m. OK GNU C11 TESTS 6 61 409600
252851622 zeppyrz A March 23, 2024, 2:12 a.m. OK GNU C11 TESTS 8 61 716800
252820840 Homaira_Jahan128 A March 22, 2024, 6:39 p.m. OK GNU C11 TESTS 7 62 409600
252828176 priyansh0506 A March 22, 2024, 7:56 p.m. OK GNU C11 TESTS 7 62 614400
252824620 enthusiasticoder A March 22, 2024, 7:18 p.m. OK GNU C11 TESTS 7 62 614400
252814584 zamanatia8 A March 22, 2024, 5:45 p.m. OK GNU C11 TESTS 7 62 614400
252812757 kshitij.roy47 A March 22, 2024, 5:33 p.m. OK GNU C11 TESTS 7 62 614400
252820656 rishabh_sankla A March 22, 2024, 6:37 p.m. OK GNU C11 TESTS 7 78 1024000
252823034 nguyenquocthao00 A March 22, 2024, 7:02 p.m. OK Go TESTS 7 46 8192000
252857750 SadFriedRice A March 23, 2024, 3:37 a.m. OK Go TESTS 8 93 4403200
252833832 crapcode A March 22, 2024, 8:57 p.m. OK Go TESTS 7 93 4403200
252864412 ajayg3059 A March 23, 2024, 5:07 a.m. OK Go TESTS 8 109 4403200
252863921 The_Dark_Lord_9635 A March 23, 2024, 5:01 a.m. OK Java 21 TESTS 8 265 0
252832497 yadavDipesh A March 22, 2024, 8:41 p.m. OK Java 21 TESTS 7 265 204800
252824621 Last-Huntsman A March 22, 2024, 7:18 p.m. OK Java 21 TESTS 7 280 102400
252865776 gaju_01 A March 23, 2024, 5:20 a.m. OK Java 21 TESTS 8 280 204800
252809582 Sanat0412 A March 22, 2024, 5:19 p.m. OK Java 21 TESTS 6 280 409600
252849606 dummy10 A March 23, 2024, 1:35 a.m. OK Java 21 TESTS 8 280 614400
252817725 swatishivam23 A March 22, 2024, 6:11 p.m. OK Java 21 TESTS 7 280 716800
252865822 gaju_01 A March 23, 2024, 5:20 a.m. OK Java 21 TESTS 8 296 0
252869553 gaju_01 A March 23, 2024, 5:50 a.m. OK Java 21 TESTS 8 296 102400
252850819 dear_earth A March 23, 2024, 1:58 a.m. OK Java 21 TESTS 8 296 102400
252826911 Mohamed_Ahmed A March 22, 2024, 7:42 p.m. OK Java 8 TESTS 7 156 2764800
252823587 wbeard01 A March 22, 2024, 7:08 p.m. OK Java 8 TESTS 7 170 0
252864436 ycnetsisnoc A March 23, 2024, 5:07 a.m. OK Java 8 TESTS 8 171 0
252825496 formidablechief27 A March 22, 2024, 7:27 p.m. OK Java 8 TESTS 7 249 78438400
252803895 jermitrina16 A March 22, 2024, 4:28 p.m. OK Java 8 TESTS 6 374 0
252803464 kierthanars A March 22, 2024, 4:27 p.m. OK Java 8 TESTS 6 374 0
252835392 upindiasarvesh A March 22, 2024, 9:15 p.m. OK Java 8 TESTS 8 389 0
252803845 YuvasreeSivakumar A March 22, 2024, 4:28 p.m. OK Java 8 TESTS 6 389 0
252801639 Chopricaa A March 22, 2024, 4:22 p.m. OK Java 8 TESTS 6 389 0
252801055 G_napika13 A March 22, 2024, 4:20 p.m. OK Java 8 TESTS 6 389 0
252804440 Siva_surya_p A March 22, 2024, 4:29 p.m. OK Kotlin 1.9 TESTS 6 436 716800
252829850 TheBoody A March 22, 2024, 8:13 p.m. OK Node.js TESTS 7 155 27443200
252830729 TheBoody A March 22, 2024, 8:22 p.m. OK Node.js TESTS 7 156 27238400
252831942 TheBoody A March 22, 2024, 8:35 p.m. OK Node.js TESTS 7 186 27136000
252830303 TheBoody A March 22, 2024, 8:18 p.m. OK Node.js TESTS 7 202 27136000
252834398 crapcode A March 22, 2024, 9:03 p.m. OK PHP TESTS 7 109 16793600
252861120 7JJJXFV9_XC A March 23, 2024, 4:23 a.m. OK PyPy 3 TESTS 8 248 12083200
252809769 logankeede A March 22, 2024, 5:19 p.m. OK PyPy 3 TESTS 6 280 12288000
252845138 mansurxon2007 A March 22, 2024, 11:59 p.m. OK PyPy 3 TESTS 8 296 11776000
252814615 gryphon A March 22, 2024, 5:45 p.m. OK PyPy 3 TESTS 7 311 11776000
252826178 Paras2856 A March 22, 2024, 7:34 p.m. OK PyPy 3 TESTS 7 342 11776000
252818202 EvGen1u5 A March 22, 2024, 6:15 p.m. OK PyPy 3 TESTS 7 374 12595200
252801014 2210030212 A March 22, 2024, 4:20 p.m. OK PyPy 3 TESTS 6 389 11776000
252842957 DrowningPhoenix A March 22, 2024, 11:16 p.m. OK PyPy 3-64 TESTS 8 124 17715200
252831531 DeathbringerY A March 22, 2024, 8:31 p.m. OK PyPy 3-64 TESTS 7 124 17817600
252816564 jvatsal0709 A March 22, 2024, 6:01 p.m. OK PyPy 3-64 TESTS 7 124 19251200
252839106 _aadiupadhyay_ A March 22, 2024, 10:05 p.m. OK PyPy 3-64 TESTS 8 124 26931200
252823614 Pronoy_Deb A March 22, 2024, 7:08 p.m. OK PyPy 3-64 TESTS 7 124 27443200
252810246 RobinFromTheHood A March 22, 2024, 5:20 p.m. OK PyPy 3-64 TESTS 6 139 17715200
252821428 _yoru_ A March 22, 2024, 6:45 p.m. OK PyPy 3-64 TESTS 7 139 18739200
252831779 amongsus A March 22, 2024, 8:34 p.m. OK PyPy 3-64 TESTS 7 139 24371200
252826204 MaxValgen_ A March 22, 2024, 7:34 p.m. OK PyPy 3-64 TESTS 7 140 16691200
252826994 MassimoG A March 22, 2024, 7:42 p.m. OK PyPy 3-64 TESTS 7 140 17715200
252809592 OLOGY A March 22, 2024, 5:19 p.m. OK Python 2 TESTS 6 155 8089600
252809714 OLOGY A March 22, 2024, 5:19 p.m. OK Python 2 TESTS 6 311 8294400
252826263 barvay A March 22, 2024, 7:35 p.m. OK Python 3 TESTS 7 92 14745600
252826311 barvay A March 22, 2024, 7:35 p.m. OK Python 3 TESTS 7 93 14643200
252826042 barvay A March 22, 2024, 7:32 p.m. OK Python 3 TESTS 7 93 14643200
252829027 harshkankhar1 A March 22, 2024, 8:05 p.m. OK Python 3 TESTS 7 93 14745600
252802989 Gooey7777 A March 22, 2024, 4:25 p.m. OK Python 3 TESTS 6 93 15769600
252865080 DL_From_Scratch A March 23, 2024, 5:13 a.m. OK Python 3 TESTS 8 93 18227200
252823210 eugalt A March 22, 2024, 7:04 p.m. OK Python 3 TESTS 7 93 20480000
252827504 harshkankhar1 A March 22, 2024, 7:48 p.m. OK Python 3 TESTS 7 108 14745600
252801592 21r21a1229 A March 22, 2024, 4:22 p.m. OK Python 3 TESTS 6 108 14745600
252854007 nazeeftham007 A March 23, 2024, 2:47 a.m. OK Python 3 TESTS 8 108 17305600
252805829 sabbirahmeds877 A March 22, 2024, 4:33 p.m. OK Ruby 3 TESTS 6 607 16179200
252822598 0x81 A March 22, 2024, 6:57 p.m. OK Ruby 3 TESTS 7 654 22732800
252802908 lollipopft A March 22, 2024, 4:25 p.m. OK Rust 2021 TESTS 6 31 5427200

remove filters

Back to search problems