Codeforces Round 1024 (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
2102 Codeforces Round 1024 (Div. 2) FINISHED False 9000 29431523 May 11, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 19717 ) B The Picky Cat PROGRAMMING sortings

You are given an array of integers (a_1, a_2, \ldots, a_n). You are allowed to do the following operation any number of times (possibly zero): Choose an index (i) ((1\le i\le n)). Multiply (a_i) by (-1) (i.e., update (a_i := -a_i)). Your task is to determine whether it is possible to make the element at index (1) become the median of the array after doing the above operation any number of times. Note that operations can be applied to index (1) as well, meaning the median can be either the original value of (a_1) or its negation. The median of an array (b_1, b_2, \ldots, b_m) is defined as the (\left\lceil \frac{m}{2} \right\rceil)-th(^{\text{∗}}) smallest element of array (b). For example, the median of the array (3, 1, 2) is (2), while the median of the array (10, 1, 8, 3) is (3). It is guaranteed that the absolute value of the elements of (a) are distinct. Formally, there are no pairs of indices (1\le i < j\le n) where (|a_i| = |a_j|). (^{\text{∗}})(\lceil x \rceil) is the ceiling function which returns the least integer greater than or equal to (x). 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 a single integer (n) ((1\le n\le 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) ((|a_i|\le 10^6), (|a_i|\neq |a_j|)) — the elements of the array (a). It is guaranteed that the sum of (n) over all test cases does not exceed (10^5). For each testcase, output " YES " if it is possible to make the element at index (1) become the median of the array, and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recogni

Tutorials

142788

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
319329285 og.kostya B May 12, 2025, 5:22 a.m. OK C# 10 TESTS 10 93 614400
319332199 IRacle B May 12, 2025, 5:55 a.m. OK C# 10 TESTS 10 109 9625600
319329507 Gu_ren B May 12, 2025, 5:25 a.m. OK C++17 (GCC 7-32) TESTS 10 61 0
319302526 shivanshc21 B May 11, 2025, 7:29 p.m. OK C++17 (GCC 7-32) TESTS 10 61 0
319280791 Nikax B May 11, 2025, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 10 61 0
319323513 Fahmid_rng B May 12, 2025, 3:54 a.m. OK C++17 (GCC 7-32) TESTS 10 61 102400
319300892 JalapenoVI9 B May 11, 2025, 7:06 p.m. OK C++17 (GCC 7-32) TESTS 10 61 102400
319331754 accord B May 12, 2025, 5:50 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
319331539 Aviral_Jain7 B May 12, 2025, 5:47 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
319331536 gradnos B May 12, 2025, 5:47 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
319330640 YadavArsh96 B May 12, 2025, 5:37 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
319327830 devastator_17 B May 12, 2025, 5:04 a.m. OK C++17 (GCC 7-32) TESTS 10 62 0
319321759 badmash_tanmay B May 12, 2025, 3:25 a.m. OK C++20 (GCC 13-64) TESTS 10 46 102400
319317430 jatin1009 B May 12, 2025, 1:52 a.m. OK C++20 (GCC 13-64) TESTS 10 46 102400
319332973 abramyouseef0 B May 12, 2025, 6:05 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
319323950 Hardi_Rakholiya B May 12, 2025, 4:02 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
319322691 jianjianj B May 12, 2025, 3:40 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
319322370 Cylarus B May 12, 2025, 3:34 a.m. OK C++20 (GCC 13-64) TESTS 10 61 0
319308809 RaghavChawla B May 11, 2025, 9:21 p.m. OK C++20 (GCC 13-64) TESTS 10 61 0
319278986 Supriyo645 B May 11, 2025, 4:28 p.m. OK C++20 (GCC 13-64) TESTS 10 61 0
319331836 Khalid_Kamal_ B May 12, 2025, 5:51 a.m. OK C++20 (GCC 13-64) TESTS 10 61 102400
319327035 ryuuko_ B May 12, 2025, 4:53 a.m. OK C++20 (GCC 13-64) TESTS 10 61 102400
319303722 apurvsardana1 B May 11, 2025, 7:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 46 0
319332223 MatinalCosmos B May 12, 2025, 5:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319328125 NKS01X B May 12, 2025, 5:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319325500 Pratyushdumdumb B May 12, 2025, 4:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319323788 Kelecyrrr B May 12, 2025, 3:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319322269 terra_sapien B May 12, 2025, 3:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319320807 stack_69 B May 12, 2025, 3:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319302507 NobitaNobi__ B May 11, 2025, 7:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319300389 Tih_Monkes B May 11, 2025, 6:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 0
319332774 Borhan2003 B May 12, 2025, 6:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 61 102400
319285993 raithu444 B May 11, 2025, 4:50 p.m. OK GNU C11 TESTS 10 78 307200
319325549 muradbhai B May 12, 2025, 4:29 a.m. OK GNU C11 TESTS 10 93 921600
319287798 code_ravan77 B May 11, 2025, 4:56 p.m. OK GNU C11 TESTS 10 108 409600
319290303 Guna_7214 B May 11, 2025, 5:03 p.m. OK GNU C11 TESTS 10 109 0
319287575 raj__7810 B May 11, 2025, 4:55 p.m. OK GNU C11 TESTS 10 109 409600
319283213 FHYfufu B May 11, 2025, 4:41 p.m. OK GNU C11 TESTS 10 109 409600
319279281 beastb728 B May 11, 2025, 4:29 p.m. OK GNU C11 TESTS 10 124 819200
319277509 1435730 B May 11, 2025, 4:23 p.m. OK GNU C11 TESTS 10 140 819200
319277143 xvnvdu B May 11, 2025, 4:22 p.m. OK Go TESTS 10 108 2150400
319330046 jindal2004keshav B May 12, 2025, 5:31 a.m. OK Java 21 TESTS 10 234 2764800
319280944 fatal-98 B May 11, 2025, 4:34 p.m. OK Java 21 TESTS 10 264 819200
319314085 aswin_t B May 12, 2025, 12:05 a.m. OK Java 21 TESTS 10 264 1331200
319317202 bomakhamchha B May 12, 2025, 1:46 a.m. OK Java 21 TESTS 10 280 1945600
319332497 ikiku B May 12, 2025, 5:59 a.m. OK Java 21 TESTS 10 281 819200
319319909 akshatsaxena552004.ss B May 12, 2025, 2:48 a.m. OK Java 21 TESTS 10 281 1945600
319328372 jindal2004keshav B May 12, 2025, 5:10 a.m. OK Java 21 TESTS 10 281 3174400
319280105 YZH_1014 B May 11, 2025, 4:31 p.m. OK Java 21 TESTS 10 296 409600
319325287 LordKRiS B May 12, 2025, 4:25 a.m. OK Java 21 TESTS 10 296 716800
319325633 the_bigShort B May 12, 2025, 4:31 a.m. OK Java 21 TESTS 10 296 819200
319323594 Trouble_shooter B May 12, 2025, 3:56 a.m. OK Java 8 TESTS 10 171 0
319332253 umeshverma07 B May 12, 2025, 5:56 a.m. OK Java 8 TESTS 10 203 0
319325832 abhaysolanki1712 B May 12, 2025, 4:34 a.m. OK Java 8 TESTS 10 281 0
319305937 HimanshuX07 B May 11, 2025, 8:20 p.m. OK Java 8 TESTS 10 296 0
319297352 sum55 B May 11, 2025, 6:25 p.m. OK Java 8 TESTS 10 296 0
319327902 priyanshu3003 B May 12, 2025, 5:05 a.m. OK Java 8 TESTS 10 327 0
319288796 Himanshu077 B May 11, 2025, 4:59 p.m. OK Java 8 TESTS 10 327 0
319297185 NavneetKumar123 B May 11, 2025, 6:23 p.m. OK Java 8 TESTS 10 343 0
319284796 AnusrutaDutta B May 11, 2025, 4:46 p.m. OK Java 8 TESTS 10 374 0
319279990 kundanaa2003 B May 11, 2025, 4:31 p.m. OK Java 8 TESTS 10 374 0
319289104 nurbold B May 11, 2025, 4:59 p.m. OK Kotlin 1.7 TESTS 10 467 28364800
319299614 ManasJain B May 11, 2025, 6:49 p.m. OK PyPy 3 TESTS 10 264 10854400
319299146 aayushprasad00691 B May 11, 2025, 6:44 p.m. OK PyPy 3 TESTS 10 312 10342400
319280286 AyanK18 B May 11, 2025, 4:32 p.m. OK PyPy 3 TESTS 10 358 10547200
319295812 Srivissy B May 11, 2025, 6:10 p.m. OK PyPy 3 TESTS 10 389 10547200
319290733 VSS240100330_AbdurRehman B May 11, 2025, 5:04 p.m. OK PyPy 3 TESTS 10 405 10547200
319306492 Toinfinity B May 11, 2025, 8:30 p.m. OK PyPy 3 TESTS 10 406 12902400
319279620 xrob B May 11, 2025, 4:29 p.m. OK PyPy 3 TESTS 10 421 10547200
319275729 Vedjani07 B May 11, 2025, 4:18 p.m. OK PyPy 3-64 TESTS 10 124 13209600
319324534 johan_1975 B May 12, 2025, 4:12 a.m. OK PyPy 3-64 TESTS 10 140 13619200
319295172 gardengnome B May 11, 2025, 6:03 p.m. OK PyPy 3-64 TESTS 10 171 13004800
319285649 serazussalekinsamin B May 11, 2025, 4:49 p.m. OK PyPy 3-64 TESTS 10 171 14028800
319299449 pink_roses B May 11, 2025, 6:47 p.m. OK PyPy 3-64 TESTS 10 186 11980800
319281278 quangnhan2006 B May 11, 2025, 4:35 p.m. OK PyPy 3-64 TESTS 10 186 13209600
319331900 Canyonzzzzz B May 12, 2025, 5:51 a.m. OK PyPy 3-64 TESTS 10 186 14028800
319287958 RuslanJR B May 11, 2025, 4:56 p.m. OK PyPy 3-64 TESTS 10 186 14028800
319285616 aziz_ghandri B May 11, 2025, 4:49 p.m. OK PyPy 3-64 TESTS 10 187 14028800
319281092 ra5anchor B May 11, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 10 187 14540800
319284946 UberShlepa B May 11, 2025, 4:47 p.m. OK Python 3 TESTS 10 93 11776000
319278309 Ujjawal_official B May 11, 2025, 4:26 p.m. OK Python 3 TESTS 10 108 11980800
319306790 eugalt B May 11, 2025, 8:35 p.m. OK Python 3 TESTS 10 109 13926400
319278662 deepakstark B May 11, 2025, 4:27 p.m. OK Python 3 TESTS 10 124 11161600
319308628 _unknown_guy B May 11, 2025, 9:16 p.m. OK Python 3 TESTS 10 124 11366400
319289942 Emikooh B May 11, 2025, 5:02 p.m. OK Python 3 TESTS 10 124 11366400
319285406 yhasmin-ccansaya B May 11, 2025, 4:48 p.m. OK Python 3 TESTS 10 124 11366400
319306301 EzzEldeen_Ali B May 11, 2025, 8:27 p.m. OK Python 3 TESTS 10 124 11571200
319285235 kraanasgard B May 11, 2025, 4:48 p.m. OK Python 3 TESTS 10 124 11571200
319323511 KRLX B May 12, 2025, 3:54 a.m. OK Python 3 TESTS 10 124 12083200
319282658 blackpanther_7 B May 11, 2025, 4:39 p.m. OK Rust 2021 TESTS 10 62 0
319327518 silicalet B May 12, 2025, 5 a.m. OK Rust 2021 TESTS 10 62 3891200
319296897 sankxt143 B May 11, 2025, 6:20 p.m. OK Rust 2021 TESTS 10 92 4198400

remove filters

Back to search problems