Educational Codeforces Round 184 (Rated for 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
2169 Educational Codeforces Round 184 (Rated for Div. 2) FINISHED False 7200 13274723 Nov. 14, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 18884 ) A Alice and Bob PROGRAMMING greedy

Alice and Bob have a bag with (n) marbles, with the integer (v_i) written on the (i)-th marble. They play the following game: first, each player chooses an integer (let's denote the integer chosen by Alice as (a), and the integer chosen by Bob as (b)). After that, they start drawing marbles from the bag in any order until the bag is empty. For each ball, the point goes to the one whose chosen integer is closer to the integer on the marble; in case of a tie, Alice gets the point . For example, if (a = 10), (b = 30), then for marbles with integers (10, 1, 7, 18, 20), and many others, Alice gets the points (note that she will get a point for the marble (20)); for marble with integer (59, 25, 30, 21), and many others, Bob gets the points. Bob has managed to find out in advance which integer Alice will choose. Help him to choose his integer in such a way as to maximize the number of points he receives. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. Each test case consists of two lines: The first line contains two integers (n) and (a) ((1 \le n \le 3 \cdot 10^5); (1 \le a \le 10^9)) — the number of marbles in the bag and the number chosen by Alice, respectively. The second line contains (n) integers (v_1, v_2, \dots, v_n) ((1 \le v_1 \le v_2 \le \dots \le v_n \le 10^9)). Additional constraint on the input: the sum of (n) across all test cases does not exceed (3 \cdot 10^5). For each test case, output a single integer (b) ((0 \le b \le 2 \cdot 10^9)) that Bob should choose to maximize the number of points he receives. If there are multiple such numbers, you may output any of them. In the first test case, if Bob chooses (35), he gets (5) points for marbles (30, 40, 50, 60, 70). In the third test case, no matter which integer Bob chooses, he gets (0) points.

Tutorials

Educational Codeforces Round 184 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
349017415 hustler_oo9 A Nov. 14, 2025, 8:19 p.m. OK C# 13 TESTS 3 124 47718400
349042512 shaiksaarakauser A Nov. 15, 2025, 4:41 a.m. OK C++17 (GCC 7-32) TESTS 3 61 0
349036100 fseazn A Nov. 15, 2025, 3:05 a.m. OK C++17 (GCC 7-32) TESTS 3 61 0
348983635 prashant_kahtri_21 A Nov. 14, 2025, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 3 61 0
349049814 Winterr A Nov. 15, 2025, 5:58 a.m. OK C++17 (GCC 7-32) TESTS 3 62 0
349028257 Luuldag A Nov. 14, 2025, 11:52 p.m. OK C++17 (GCC 7-32) TESTS 3 62 0
348999504 Binary-Brigade A Nov. 14, 2025, 5:43 p.m. OK C++17 (GCC 7-32) TESTS 3 62 0
348981602 tamasoki500 A Nov. 14, 2025, 4:22 p.m. OK C++17 (GCC 7-32) TESTS 3 62 0
349018313 Code.Virtuoso A Nov. 14, 2025, 8:30 p.m. OK C++17 (GCC 7-32) TESTS 3 62 819200
348987409 sandercy22 A Nov. 14, 2025, 4:32 p.m. OK C++17 (GCC 7-32) TESTS 3 62 11161600
349049384 NeonSkies898 A Nov. 15, 2025, 5:54 a.m. OK C++17 (GCC 7-32) TESTS 3 77 0
348990692 _crn_ A Nov. 14, 2025, 4:43 p.m. OK C++20 (GCC 13-64) TESTS 3 46 0
349031936 xiaochen111 A Nov. 15, 2025, 1:41 a.m. OK C++20 (GCC 13-64) TESTS 3 46 20480000
349049355 Keyur11 A Nov. 15, 2025, 5:53 a.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349026989 ganta.jashu A Nov. 14, 2025, 11:09 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349022904 max0000561 A Nov. 14, 2025, 9:37 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349021352 maanassehgal A Nov. 14, 2025, 9:13 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349018487 pratycodes A Nov. 14, 2025, 8:32 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349009221 nilesh_27 A Nov. 14, 2025, 6:59 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349008500 trolleybag A Nov. 14, 2025, 6:53 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349004954 25Kazumi A Nov. 14, 2025, 6:24 p.m. OK C++20 (GCC 13-64) TESTS 3 61 0
349047225 yxylx A Nov. 15, 2025, 5:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
349038273 I_cp_in_html A Nov. 15, 2025, 3:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
349032833 moon_nine A Nov. 15, 2025, 2:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
349017485 3ASSEM_1 A Nov. 14, 2025, 8:20 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
348997198 raunistotle A Nov. 14, 2025, 5:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
348997121 RED_BAVARIAN A Nov. 14, 2025, 5:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
348994944 abhi2601d A Nov. 14, 2025, 5:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
348991326 azureboy A Nov. 14, 2025, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
348990121 NITUL_ A Nov. 14, 2025, 4:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
348983253 NITUL__ A Nov. 14, 2025, 4:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
349002145 hk_moistduck A Nov. 14, 2025, 6:03 p.m. OK GNU C11 TESTS 3 77 1126400
349000183 pranjalbaranwal304 A Nov. 14, 2025, 5:48 p.m. OK GNU C11 TESTS 3 77 1228800
349008615 Mysni A Nov. 14, 2025, 6:54 p.m. OK GNU C11 TESTS 3 77 2355200
348996111 ayushflux A Nov. 14, 2025, 5:17 p.m. OK GNU C11 TESTS 3 92 0
349014188 noobGODmax A Nov. 14, 2025, 7:44 p.m. OK GNU C11 TESTS 3 92 1228800
349007143 Dhyey_0075 A Nov. 14, 2025, 6:42 p.m. OK GNU C11 TESTS 3 93 1228800
349023008 Mysni A Nov. 14, 2025, 9:39 p.m. OK GNU C11 TESTS 3 93 2457600
348989153 loop-the-loop A Nov. 14, 2025, 4:34 p.m. OK GNU C11 TESTS 3 108 0
348987700 Arya_K_25 A Nov. 14, 2025, 4:33 p.m. OK GNU C11 TESTS 3 108 10752000
348997077 MadCoder... A Nov. 14, 2025, 5:25 p.m. OK GNU C11 TESTS 3 124 2355200
348985286 ZeroTestPassed A Nov. 14, 2025, 4:29 p.m. OK Go TESTS 3 46 4608000
348990739 hrzhonchizhevoshice A Nov. 14, 2025, 4:44 p.m. OK Go TESTS 3 171 4608000
349017298 Cyborg2510 A Nov. 14, 2025, 8:18 p.m. OK Go TESTS 3 1999 6758400
348990875 ccj123 A Nov. 14, 2025, 4:44 p.m. OK Java 21 TESTS 3 218 716800
349018122 knightL A Nov. 14, 2025, 8:28 p.m. OK Java 21 TESTS 3 234 307200
349048360 _aditya_pratap_ A Nov. 15, 2025, 5:44 a.m. OK Java 21 TESTS 3 249 204800
349029474 2251307025 A Nov. 15, 2025, 12:35 a.m. OK Java 21 TESTS 3 249 3686400
349016037 CautiousCoder A Nov. 14, 2025, 8:03 p.m. OK Java 21 TESTS 3 249 4505600
349041331 yallavamsipavan A Nov. 15, 2025, 4:25 a.m. OK Java 21 TESTS 3 249 5734400
349039850 ZhangQingze A Nov. 15, 2025, 4:04 a.m. OK Java 21 TESTS 3 249 6041600
348980254 gintoki22 A Nov. 14, 2025, 4:19 p.m. OK Java 21 TESTS 3 249 6144000
349049818 amit_roy A Nov. 15, 2025, 5:58 a.m. OK Java 21 TESTS 3 264 819200
349049789 priyaroy3370 A Nov. 15, 2025, 5:57 a.m. OK Java 21 TESTS 3 264 819200
349027704 sarthaKKharKa_18 A Nov. 14, 2025, 11:33 p.m. OK Java 8 TESTS 3 140 0
349041309 yallavamsipavan A Nov. 15, 2025, 4:24 a.m. OK Java 8 TESTS 3 186 13516800
349041156 yallavamsipavan A Nov. 15, 2025, 4:22 a.m. OK Java 8 TESTS 3 186 13516800
348983198 TejashRamdharani A Nov. 14, 2025, 4:25 p.m. OK Java 8 TESTS 3 187 9625600
349041412 yallavamsipavan A Nov. 15, 2025, 4:26 a.m. OK Java 8 TESTS 3 202 13516800
349041381 yallavamsipavan A Nov. 15, 2025, 4:25 a.m. OK Java 8 TESTS 3 233 13516800
349033432 abhayrajnegi0416 A Nov. 15, 2025, 2:14 a.m. OK Java 8 TESTS 3 234 14131200
348983490 Anant-27 A Nov. 14, 2025, 4:26 p.m. OK Java 8 TESTS 3 296 37171200
348982855 Anant-27 A Nov. 14, 2025, 4:24 p.m. OK Java 8 TESTS 3 311 37171200
349011665 krishna_s_kapale A Nov. 14, 2025, 7:21 p.m. OK Java 8 TESTS 3 515 0
349015583 JagannathHari A Nov. 14, 2025, 7:58 p.m. OK PyPy 3 TESTS 3 343 19865600
349000003 Struggle1259 A Nov. 14, 2025, 5:47 p.m. OK PyPy 3 TESTS 3 343 25497600
348995587 Nandynamic A Nov. 14, 2025, 5:14 p.m. OK PyPy 3 TESTS 3 374 25292800
348981067 Z_Kamronbek A Nov. 14, 2025, 4:21 p.m. OK PyPy 3 TESTS 3 374 25395200
349030296 utsab77 A Nov. 15, 2025, 1:02 a.m. OK PyPy 3 TESTS 3 405 22118400
349006642 noobGODmax A Nov. 14, 2025, 6:38 p.m. OK PyPy 3-64 TESTS 3 124 31232000
349017835 MEhs313 A Nov. 14, 2025, 8:24 p.m. OK PyPy 3-64 TESTS 3 124 33484800
349015479 9thJune2006 A Nov. 14, 2025, 7:57 p.m. OK PyPy 3-64 TESTS 3 139 39424000
349012495 dharmendra2601 A Nov. 14, 2025, 7:28 p.m. OK PyPy 3-64 TESTS 3 139 44544000
348989911 Lamohehe A Nov. 14, 2025, 4:39 p.m. OK PyPy 3-64 TESTS 3 140 27955200
349035618 brooks72 A Nov. 15, 2025, 2:56 a.m. OK PyPy 3-64 TESTS 3 140 30617600
349007655 noobGODmax A Nov. 14, 2025, 6:46 p.m. OK PyPy 3-64 TESTS 3 140 31232000
349028785 dhrxv._ A Nov. 15, 2025, 12:11 a.m. OK PyPy 3-64 TESTS 3 140 34304000
348983781 MatthewCode A Nov. 14, 2025, 4:26 p.m. OK PyPy 3-64 TESTS 3 140 36454400
348989427 RobinFromTheHood A Nov. 14, 2025, 4:38 p.m. OK PyPy 3-64 TESTS 3 140 39321600
348986559 kiruthika_024 A Nov. 14, 2025, 4:31 p.m. OK Python 3 TESTS 3 109 37171200
348986099 coder220306 A Nov. 14, 2025, 4:30 p.m. OK Python 3 TESTS 3 124 36044800
348985402 joevinthomas2 A Nov. 14, 2025, 4:29 p.m. OK Python 3 TESTS 3 124 36147200
349007314 SnooPredictions7675 A Nov. 14, 2025, 6:44 p.m. OK Python 3 TESTS 3 124 37171200
348988440 kanishkm2008 A Nov. 14, 2025, 4:34 p.m. OK Python 3 TESTS 3 124 37376000
349043000 Anupam56 A Nov. 15, 2025, 4:48 a.m. OK Python 3 TESTS 3 139 37171200
349009192 saadm A Nov. 14, 2025, 6:59 p.m. OK Python 3 TESTS 3 140 37068800
348985247 madhura_27 A Nov. 14, 2025, 4:29 p.m. OK Python 3 TESTS 3 140 37171200
349046573 HK-Athy A Nov. 15, 2025, 5:26 a.m. OK Python 3 TESTS 3 140 37376000
348981279 MikeYuanP A Nov. 14, 2025, 4:21 p.m. OK Python 3 TESTS 3 140 38912000
349042724 niquefa_diego A Nov. 15, 2025, 4:44 a.m. OK Rust 2024 TESTS 3 61 2252800
349003327 allcaps A Nov. 14, 2025, 6:12 p.m. OK Rust 2024 TESTS 3 61 5427200
348995860 CoHHa9_MyXa A Nov. 14, 2025, 5:16 p.m. OK Rust 2024 TESTS 3 93 29900800

remove filters

Back to search problems