Codeforces Round 1026 (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
2110 Codeforces Round 1026 (Div. 2) FINISHED False 7200 28308323 May 24, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 29699 ) A Fashionable Array PROGRAMMING implementation sortings

In 2077, everything became fashionable among robots, even arrays... We will call an array of integers (a) fashionable if (\min(a) + \max(a)) is divisible by (2) without a remainder, where (\min(a)) — the value of the minimum element of the array (a), and (\max(a)) — the value of the maximum element of the array (a). You are given an array of integers (a_1, a_2, \ldots, a_n). In one operation, you can remove any element from this array. Your task is to determine the minimum number of operations required to make the array (a) fashionable . Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^3)). The description of the test cases follows. The first line of each test case contains one integer (n) ((1 \leq n \leq 50)) — the size of the array (a). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \leq a_i \leq 50)) — the elements of the array (a). For each test case, output one integer — the minimum number of operations required to make the array (a) fashionable . In the first test case, at least one element needs to be removed since (\min(a)+\max(a)=2+5=7), and (7) is not divisible by (2). If any of the elements are removed, only one element will remain. Then (\max(a) + \min(a)) will be divisible by (2). In the second test case, nothing needs to be removed since (\min(a)+\max(a)=1+9=10), and (10) is divisible by (2). In the third test case, you can remove the elements with values (2) and (4), then (\min(a)+\max(a)=5+11=16), and (16) is divisible by (2).

Tutorials

Codeforces Round 1026 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
321148220 IRacle A May 24, 2025, 5:26 p.m. OK C# 10 TESTS 4 109 2867200
321171063 ff465593 A May 24, 2025, 9:39 p.m. OK C++17 (GCC 7-32) TESTS 4 30 1638400
321193286 AdityABIRLA2005 A May 25, 2025, 4:41 a.m. OK C++17 (GCC 7-32) TESTS 4 31 0
321157149 vishalmukkannavar690 A May 24, 2025, 6:31 p.m. OK C++17 (GCC 7-32) TESTS 4 31 0
321156585 Leelasai_2004 A May 24, 2025, 6:26 p.m. OK C++17 (GCC 7-32) TESTS 4 31 0
321148214 its_vps A May 24, 2025, 5:26 p.m. OK C++17 (GCC 7-32) TESTS 4 31 0
321147183 Abdur_Rafi_Hasan A May 24, 2025, 5:21 p.m. OK C++17 (GCC 7-32) TESTS 4 31 0
321184914 eargle A May 25, 2025, 2:24 a.m. OK C++17 (GCC 7-32) TESTS 4 31 102400
321200148 aniket125 A May 25, 2025, 5:59 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
321199890 kupa2612 A May 25, 2025, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
321199591 Azharulkarim A May 25, 2025, 5:53 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
321190583 ravib.code A May 25, 2025, 4:03 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
321184134 jjwawy999 A May 25, 2025, 2:08 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
321183409 melonseeds A May 25, 2025, 1:48 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
321167789 Priya_Bisht10 A May 24, 2025, 8:33 p.m. OK C++20 (GCC 13-64) TESTS 4 31 0
321161178 kloro A May 24, 2025, 7:11 p.m. OK C++20 (GCC 13-64) TESTS 4 31 0
321153977 ladailoc A May 24, 2025, 6:04 p.m. OK C++20 (GCC 13-64) TESTS 4 31 102400
321148884 Hardi_Rakholiya A May 24, 2025, 5:29 p.m. OK C++20 (GCC 13-64) TESTS 4 31 102400
321147198 ashwin_22 A May 24, 2025, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 4 31 102400
321166144 Mahm2od A May 24, 2025, 8:10 p.m. OK C++20 (GCC 13-64) TESTS 4 31 16076800
321200685 prakeet13 A May 25, 2025, 6:04 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
321192801 abdinabiev1 A May 25, 2025, 4:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
321150868 Cartel_de_Code A May 24, 2025, 5:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
321192162 dzhoz0 A May 25, 2025, 4:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 102400
321199979 Mazen_Ghourab A May 25, 2025, 5:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321193848 forforforforfor A May 25, 2025, 4:47 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321193409 mhidi A May 25, 2025, 4:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321189948 namansinghjarodiya A May 25, 2025, 3:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321188499 sahil_beck A May 25, 2025, 3:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321184272 tvn123 A May 25, 2025, 2:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321183202 juni-arjun A May 25, 2025, 1:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
321183621 OFH A May 25, 2025, 1:54 a.m. OK GNU C11 TESTS 4 46 0
321156254 aayushkanade29 A May 24, 2025, 6:23 p.m. OK GNU C11 TESTS 4 46 0
321155420 jaintlemann A May 24, 2025, 6:16 p.m. OK GNU C11 TESTS 4 46 0
321138151 arhamcode11 A May 24, 2025, 4:25 p.m. OK GNU C11 TESTS 4 46 0
321187265 141728 A May 25, 2025, 3:08 a.m. OK GNU C11 TESTS 4 46 102400
321172651 aaryanp1980 A May 24, 2025, 10:23 p.m. OK GNU C11 TESTS 4 46 102400
321170215 BISWAJIT A May 24, 2025, 9:19 p.m. OK GNU C11 TESTS 4 46 102400
321138769 me24bt022 A May 24, 2025, 4:26 p.m. OK GNU C11 TESTS 4 46 102400
321162723 zerojanuary A May 24, 2025, 7:28 p.m. OK GNU C11 TESTS 4 61 0
321153764 monish1406 A May 24, 2025, 6:03 p.m. OK GNU C11 TESTS 4 61 0
321160466 dils2k A May 24, 2025, 7:03 p.m. OK Go TESTS 4 61 716800
321189121 aparimeet A May 25, 2025, 3:40 a.m. OK Go TESTS 4 140 2969600
321174193 yillin A May 24, 2025, 11:20 p.m. OK Go TESTS 4 171 2662400
321199375 snehakanodia4 A May 25, 2025, 5:51 a.m. OK Java 21 TESTS 4 187 42905600
321192024 shivashish A May 25, 2025, 4:23 a.m. OK Java 21 TESTS 4 218 409600
321147267 iamrlm A May 24, 2025, 5:21 p.m. OK Java 21 TESTS 4 233 512000
321200772 AKhacks A May 25, 2025, 6:05 a.m. OK Java 21 TESTS 4 233 819200
321193881 Archith1 A May 25, 2025, 4:48 a.m. OK Java 21 TESTS 4 234 409600
321167924 arshia_singh A May 24, 2025, 8:35 p.m. OK Java 21 TESTS 4 234 1024000
321148478 sahasrad A May 24, 2025, 5:27 p.m. OK Java 21 TESTS 4 249 204800
321147390 sajjan28yadav A May 24, 2025, 5:21 p.m. OK Java 21 TESTS 4 249 921600
321161175 aamrubel A May 24, 2025, 7:11 p.m. OK Java 21 TESTS 4 249 1228800
321173655 qavkour A May 24, 2025, 11 p.m. OK Java 21 TESTS 4 264 819200
321196426 navneet_404 A May 25, 2025, 5:19 a.m. OK Java 8 TESTS 4 202 0
321157658 Ayusharma17 A May 24, 2025, 6:36 p.m. OK Java 8 TESTS 4 202 0
321157544 Idiotic_fellow327 A May 24, 2025, 6:35 p.m. OK Java 8 TESTS 4 202 0
321198298 not_mohith A May 25, 2025, 5:39 a.m. OK Java 8 TESTS 4 218 0
321197544 not_mohith A May 25, 2025, 5:32 a.m. OK Java 8 TESTS 4 218 0
321194712 PratikSahoo A May 25, 2025, 4:59 a.m. OK Java 8 TESTS 4 218 0
321165700 Shafat04 A May 24, 2025, 8:03 p.m. OK Java 8 TESTS 4 218 0
321156107 anshika_bansal2430 A May 24, 2025, 6:21 p.m. OK Java 8 TESTS 4 218 0
321157367 Kazuuu A May 24, 2025, 6:33 p.m. OK Java 8 TESTS 4 249 0
321148331 vive02-xo A May 24, 2025, 5:26 p.m. OK Java 8 TESTS 4 249 0
321163216 HowOld A May 24, 2025, 7:33 p.m. OK Kotlin 1.9 TESTS 4 217 1740800
321137822 tough_kenya A May 24, 2025, 4:24 p.m. OK Mono C# TESTS 4 124 6758400
321150650 v_krystle A May 24, 2025, 5:40 p.m. OK Node.js TESTS 4 109 2252800
321173418 Abdalkhalig A May 24, 2025, 10:52 p.m. OK PyPy 3 TESTS 4 156 4812800
321175445 Listar A May 25, 2025, 12:06 a.m. OK PyPy 3 TESTS 4 264 5632000
321153009 sky_coder_ A May 24, 2025, 5:57 p.m. OK PyPy 3 TESTS 4 296 5529600
321163287 bravotango A May 24, 2025, 7:34 p.m. OK PyPy 3-64 TESTS 4 92 1740800
321158198 bravotango A May 24, 2025, 6:41 p.m. OK PyPy 3-64 TESTS 4 93 2252800
321172188 028 A May 24, 2025, 10:09 p.m. OK PyPy 3-64 TESTS 4 93 2969600
321161262 bravotango A May 24, 2025, 7:12 p.m. OK PyPy 3-64 TESTS 4 93 3584000
321159819 rmr A May 24, 2025, 6:57 p.m. OK PyPy 3-64 TESTS 4 108 1843200
321159491 nakshatramandowara A May 24, 2025, 6:53 p.m. OK PyPy 3-64 TESTS 4 108 2457600
321149895 Creydit A May 24, 2025, 5:35 p.m. OK PyPy 3-64 TESTS 4 108 2457600
321171094 welshman_11 A May 24, 2025, 9:40 p.m. OK PyPy 3-64 TESTS 4 108 2969600
321151311 Anirban2046 A May 24, 2025, 5:44 p.m. OK PyPy 3-64 TESTS 4 109 2252800
321149776 Aasuren A May 24, 2025, 5:35 p.m. OK PyPy 3-64 TESTS 4 109 2764800
321163542 polanskiefrain7 A May 24, 2025, 7:37 p.m. OK Python 2 TESTS 4 625 921600
321188286 Gias_uddin_vuiya A May 25, 2025, 3:26 a.m. OK Python 3 TESTS 4 46 204800
321184548 OLOGY A May 25, 2025, 2:17 a.m. OK Python 3 TESTS 4 61 0
321191549 wjy A May 25, 2025, 4:17 a.m. OK Python 3 TESTS 4 61 102400
321198644 0-dayCoder A May 25, 2025, 5:43 a.m. OK Python 3 TESTS 4 61 307200
321151659 samarth.sahu.feb2005 A May 24, 2025, 5:47 p.m. OK Python 3 TESTS 4 61 1331200
321200313 eshanahmed108 A May 25, 2025, 6 a.m. OK Python 3 TESTS 4 62 0
321169952 elistark A May 24, 2025, 9:13 p.m. OK Python 3 TESTS 4 62 204800
321164991 adityasoftdev A May 24, 2025, 7:54 p.m. OK Python 3 TESTS 4 62 204800
321150929 prakhar11jha A May 24, 2025, 5:42 p.m. OK Python 3 TESTS 4 62 307200
321149703 kshitij2407 A May 24, 2025, 5:34 p.m. OK Python 3 TESTS 4 62 307200
321143924 habuev A May 24, 2025, 4:34 p.m. OK Rust 2021 TESTS 4 46 0
321171787 SnowballSH A May 24, 2025, 9:58 p.m. OK Rust 2021 TESTS 4 61 0
321158385 hodor12 A May 24, 2025, 6:42 p.m. OK Rust 2021 TESTS 4 61 0
321156180 no_ether A May 24, 2025, 6:22 p.m. OK Rust 2021 TESTS 4 61 0

remove filters

Back to search problems