Codeforces Round 924 (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
1928 Codeforces Round 924 (Div. 2) FINISHED False 7200 24179099 Feb. 11, 2024, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17695 ) B Equalize PROGRAMMING binary search greedy sortings two pointers

B'Vasya has two hobbies -- adding permutations ^{ dagger} to arrays and finding the most frequently occurring element. Recently, he found an array a and decided to find out the maximum number of elements equal to the same number in the array a that he can obtain after adding some permutation to the array a . More formally, Vasya must choose exactly one permutation p_1, p_2, p_3, ldots, p_n of length n , and then change the elements of the array a according to the rule a_i := a_i + p_i . After that, Vasya counts how many times each number occurs in the array a and takes the maximum of these values. You need to determine the maximum value he can obtain. ^{ dagger} A permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array), and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 2 cdot 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 <= 2 cdot 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 elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single number -- the maximum number of elements equal to the same number after the operation of adding a permutation. In the first test case, it is optimal to choose p = [2, 1] . Then after applying the operation, the array a will be [3, 3] , in which the number 3 occu'...

Tutorials

Codeforces Round 924 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
245914649 Anastasiya_Andreevna B Feb. 11, 2024, 8:14 p.m. OK C# 10 TESTS 10 171 23859200
245914309 Anastasiya_Andreevna B Feb. 11, 2024, 8:10 p.m. OK C# 10 TESTS 10 249 25600000
245927925 bluemegane B Feb. 12, 2024, 12:47 a.m. OK C# 8 TESTS 10 218 27136000
245885113 ravinem1 B Feb. 11, 2024, 3:56 p.m. OK C# 8 TESTS 10 218 28672000
245877836 NenadDapic B Feb. 11, 2024, 3:06 p.m. OK FPC TESTS 10 139 1740800
245886332 Calvin65 B Feb. 11, 2024, 4:05 p.m. OK GNU C11 TESTS 10 124 1024000
245860587 shenlongzunzhe B Feb. 11, 2024, 1:02 p.m. OK GNU C11 TESTS 10 139 1843200
245871970 WASIF_74 B Feb. 11, 2024, 2:26 p.m. OK GNU C11 TESTS 10 202 1638400
245853147 ansaafff B Feb. 11, 2024, 12:04 p.m. OK GNU C++17 TESTS 9 46 819200
245882395 Darshanraj B Feb. 11, 2024, 3:37 p.m. OK GNU C++17 TESTS 10 61 819200
245934121 _suraj_2003 B Feb. 12, 2024, 3:28 a.m. OK GNU C++17 TESTS 10 61 819200
245928489 Rahul7_77 B Feb. 12, 2024, 1:05 a.m. OK GNU C++17 TESTS 10 61 2457600
245901560 vidhvansak007 B Feb. 11, 2024, 6:02 p.m. OK GNU C++17 TESTS 10 62 819200
245898870 not_wiz B Feb. 11, 2024, 5:40 p.m. OK GNU C++17 TESTS 10 62 819200
245884720 Sanchit_Negi B Feb. 11, 2024, 3:54 p.m. OK GNU C++17 TESTS 10 62 819200
245910502 Chris_Black B Feb. 11, 2024, 7:27 p.m. OK GNU C++17 TESTS 10 62 819200
245925630 bitthal04 B Feb. 11, 2024, 11:34 p.m. OK GNU C++17 TESTS 10 62 819200
245934377 mercer_2.0 B Feb. 12, 2024, 3:33 a.m. OK GNU C++17 TESTS 10 62 819200
245854440 chappy1 B Feb. 11, 2024, 12:13 p.m. OK GNU C++17 (64) TESTS 9 31 1843200
245932692 yangbalu B Feb. 12, 2024, 2:59 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245939324 lqm123 B Feb. 12, 2024, 5:04 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245934553 _Sunmoon_ B Feb. 12, 2024, 3:36 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245931782 shoshoshom B Feb. 12, 2024, 2:37 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245930551 GCDback B Feb. 12, 2024, 2:02 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245929733 wuhupai B Feb. 12, 2024, 1:41 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245929721 wuhupai B Feb. 12, 2024, 1:41 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245929708 wuhupai B Feb. 12, 2024, 1:41 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245927292 JiaZiXin B Feb. 12, 2024, 12:24 a.m. OK GNU C++17 (64) TESTS 10 46 819200
245858927 Huangyf B Feb. 11, 2024, 12:49 p.m. OK GNU C++20 (64) TESTS 10 31 819200
245856510 Limie B Feb. 11, 2024, 12:28 p.m. OK GNU C++20 (64) TESTS 9 31 819200
245854175 Lu_Kai B Feb. 11, 2024, 12:11 p.m. OK GNU C++20 (64) TESTS 9 31 819200
245853042 Lu_Kai B Feb. 11, 2024, 12:03 p.m. OK GNU C++20 (64) TESTS 9 31 819200
245873384 not_milad B Feb. 11, 2024, 2:38 p.m. OK GNU C++20 (64) TESTS 10 31 819200
245886129 Stachu B Feb. 11, 2024, 4:04 p.m. OK GNU C++20 (64) TESTS 10 31 819200
245931406 PranavAdlinge B Feb. 12, 2024, 2:27 a.m. OK GNU C++20 (64) TESTS 10 31 819200
245871701 Kiffaz B Feb. 11, 2024, 2:24 p.m. OK GNU C++20 (64) TESTS 10 31 1126400
245941059 I_m_lipon B Feb. 12, 2024, 5:30 a.m. OK GNU C++20 (64) TESTS 10 31 1638400
245941375 Masu_m B Feb. 12, 2024, 5:35 a.m. OK GNU C++20 (64) TESTS 10 31 1638400
245890869 euclidstellar B Feb. 11, 2024, 4:37 p.m. OK Go TESTS 10 61 10035200
245886533 CutSandstone B Feb. 11, 2024, 4:07 p.m. OK Java 21 TESTS 10 280 4300800
245854022 AkshatSaxena_05 B Feb. 11, 2024, 12:10 p.m. OK Java 21 TESTS 9 311 0
245923825 kettlescott B Feb. 11, 2024, 10:47 p.m. OK Java 21 TESTS 10 358 307200
245911422 AKhacks B Feb. 11, 2024, 7:37 p.m. OK Java 21 TESTS 10 358 307200
245869504 _Titans_ B Feb. 11, 2024, 2:07 p.m. OK Java 21 TESTS 10 358 10956800
245854938 priyaroy3370 B Feb. 11, 2024, 12:16 p.m. OK Java 21 TESTS 9 358 15872000
245882824 bhavya_boda B Feb. 11, 2024, 3:40 p.m. OK Java 21 TESTS 10 358 18636800
245885045 BurnerAce B Feb. 11, 2024, 3:56 p.m. OK Java 21 TESTS 10 374 20275200
245891199 Pratik_M07 B Feb. 11, 2024, 4:39 p.m. OK Java 21 TESTS 10 389 9932800
245906836 headshot1703 B Feb. 11, 2024, 6:49 p.m. OK Java 21 TESTS 10 405 20070400
245858501 Sumitsingh7 B Feb. 11, 2024, 12:45 p.m. OK Java 8 TESTS 10 249 7782400
245850955 _abstract_ B Feb. 11, 2024, 11:52 a.m. OK Java 8 TESTS 8 264 17203200
245883106 2100030438_CSEH B Feb. 11, 2024, 3:42 p.m. OK Java 8 TESTS 10 264 22528000
245866446 achyut88 B Feb. 11, 2024, 1:45 p.m. OK Java 8 TESTS 10 326 13107200
245892398 Ancient_One B Feb. 11, 2024, 4:49 p.m. OK Java 8 TESTS 10 327 6246400
245937427 jitu7033 B Feb. 12, 2024, 4:32 a.m. OK Java 8 TESTS 10 358 39833600
245926647 Harwinvanak B Feb. 12, 2024, 12:04 a.m. OK Java 8 TESTS 10 451 36249600
245930345 aryanartist30 B Feb. 12, 2024, 1:58 a.m. OK Java 8 TESTS 10 498 11366400
245935652 Saha_Souvik B Feb. 12, 2024, 3:58 a.m. OK Java 8 TESTS 10 514 0
245896351 _UPG_ B Feb. 11, 2024, 5:21 p.m. OK Java 8 TESTS 10 514 9318400
245886186 sam__in07 B Feb. 11, 2024, 4:04 p.m. OK Kotlin 1.9 TESTS 10 342 15564800
245851045 ahmedwaelyousry B Feb. 11, 2024, 11:52 a.m. OK MS C++ 2017 TESTS 8 202 3993600
245910676 ahethesham8 B Feb. 11, 2024, 7:29 p.m. OK MS C++ 2017 TESTS 10 233 2150400
245856823 FirstStep0 B Feb. 11, 2024, 12:31 p.m. OK MS C++ 2017 TESTS 9 234 819200
245862041 priyanshu9506992625 B Feb. 11, 2024, 1:14 p.m. OK MS C++ 2017 TESTS 10 249 2150400
245870337 alchemyst B Feb. 11, 2024, 2:13 p.m. OK MS C++ 2017 TESTS 10 249 2252800
245908464 maximzasorin B Feb. 11, 2024, 7:06 p.m. OK PHP TESTS 10 109 29388800
245893617 FireBird23 B Feb. 11, 2024, 4:59 p.m. OK PyPy 3 TESTS 10 202 22118400
245899915 seeforty4040 B Feb. 11, 2024, 5:49 p.m. OK PyPy 3 TESTS 10 311 17100800
245854251 Kintsugi B Feb. 11, 2024, 12:11 p.m. OK PyPy 3 TESTS 9 686 16281600
245860469 Giantpanda B Feb. 11, 2024, 1:01 p.m. OK PyPy 3 TESTS 10 701 16179200
245916608 gardengnome B Feb. 11, 2024, 8:41 p.m. OK PyPy 3-64 TESTS 10 140 25190400
245915333 NitroSpear B Feb. 11, 2024, 8:23 p.m. OK PyPy 3-64 TESTS 10 140 25395200
245924002 cybsbbb B Feb. 11, 2024, 10:50 p.m. OK PyPy 3-64 TESTS 10 140 27033600
245892202 maheshraju2020 B Feb. 11, 2024, 4:47 p.m. OK PyPy 3-64 TESTS 10 140 157184000
245902596 Axeley B Feb. 11, 2024, 6:11 p.m. OK PyPy 3-64 TESTS 10 155 19558400
245856398 eunsoo0607 B Feb. 11, 2024, 12:27 p.m. OK PyPy 3-64 TESTS 9 155 22425600
245917834 Dert30 B Feb. 11, 2024, 8:57 p.m. OK PyPy 3-64 TESTS 10 155 25088000
245924070 cybsbbb B Feb. 11, 2024, 10:52 p.m. OK PyPy 3-64 TESTS 10 155 26316800
245930581 aviral311 B Feb. 12, 2024, 2:03 a.m. OK PyPy 3-64 TESTS 10 155 27238400
245875646 yertugan06 B Feb. 11, 2024, 2:53 p.m. OK PyPy 3-64 TESTS 10 155 32358400
245852583 OLOGY B Feb. 11, 2024, noon OK Python 2 TESTS 9 171 12492800
245851576 OLOGY B Feb. 11, 2024, 11:55 a.m. OK Python 2 TESTS 8 249 12492800
245909427 DrCoder9146 B Feb. 11, 2024, 7:15 p.m. OK Python 3 TESTS 10 202 27033600
245924427 momenelmesady4803 B Feb. 11, 2024, 11:01 p.m. OK Python 3 TESTS 10 202 35737600
245912324 singh.eureka B Feb. 11, 2024, 7:47 p.m. OK Python 3 TESTS 10 202 35737600
245940206 shruthi195 B Feb. 12, 2024, 5:17 a.m. OK Python 3 TESTS 10 217 36044800
245929551 pennymagic156 B Feb. 12, 2024, 1:37 a.m. OK Python 3 TESTS 10 218 27033600
245854460 Hodobox B Feb. 11, 2024, 12:13 p.m. OK Python 3 TESTS 9 233 26521600
245878349 n-pulse B Feb. 11, 2024, 3:10 p.m. OK Python 3 TESTS 10 233 26931200
245939922 OmarMoBadr B Feb. 12, 2024, 5:13 a.m. OK Python 3 TESTS 10 233 27033600
245905090 Ratery B Feb. 11, 2024, 6:33 p.m. OK Python 3 TESTS 10 233 35635200
245869619 kunalseth B Feb. 11, 2024, 2:08 p.m. OK Python 3 TESTS 10 233 35635200
245877045 vstiff B Feb. 11, 2024, 3:02 p.m. OK Rust 2021 TESTS 10 31 6144000
245895617 jhonyn B Feb. 11, 2024, 5:15 p.m. OK Rust 2021 TESTS 10 140 6553600
245936602 manan180796 B Feb. 12, 2024, 4:16 a.m. OK Rust 2021 TESTS 10 187 14745600

remove filters

Back to search problems