Codeforces Round 862 (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
1805 Codeforces Round 862 (Div. 2) FINISHED False 7200 51377099 April 2, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 353 ) F2 Survival of the Weakest (hard version) PROGRAMMING greedy sortings two pointers

B'This is the hard version of the problem. It differs from the easy one only in constraints on n . You can make hacks only if you lock both versions. Let a_1, a_2, ldots, a_n be an array of non-negative integers. Let F(a_1, a_2, ldots, a_n) be the sorted in the non-decreasing order array of n - 1 smallest numbers of the form a_i + a_j , where 1 <= i < j <= n . In other words, F(a_1, a_2, ldots, a_n) is the sorted in the non-decreasing order array of n - 1 smallest sums of all possible pairs of elements of the array a_1, a_2, ldots, a_n . For example, F(1, 2, 5, 7) = [1 + 2, 1 + 5, 2 + 5] = [3, 6, 7] . You are given an array of non-negative integers a_1, a_2, ldots, a_n . Determine the single element of the array underbrace{F(F(F ldots F}_{n-1}(a_1, a_2, ldots, a_n) ldots)) . Since the answer can be quite large, output it modulo 10^9+7 . The first line contains one integer n ( 2 <= n <= 2 cdot 10^5 ) -- the initial length of the array. The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= 10^9 ) -- the array elements. Output a single number -- the answer modulo 10^9 + 7 . In the first test, the array is transformed as follows: [1, 2, 4, 5, 6] to [3, 5, 6, 6] to [8, 9, 9] to [17, 17] to [34] . The only element of the final array is 34 . In the second test, F(a_1, a_2, ldots, a_n) is [2, 2, 2, 8, 8, 8, 8, 8] . This array is made up of 3 numbers of the form 1 + 1 and 5 numbers of the form 1 + 7 . In the fourth test, the array is transformed as follows: [10^9, 10^9, 777] to [10^9+777, 10^9+777] to [2 cdot 10^9 + 1554] . 2 cdot 10^9 + 1554 modulo 10^9+7 equals 1540 . '...

Tutorials

Editorial of Codeforces Round #862 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
200471927 rainboy F2 April 2, 2023, 7:17 p.m. OK GNU C11 TESTS 119 670 819200
200456419 fallleaves07 F2 April 2, 2023, 5:20 p.m. OK GNU C++17 TESTS 119 421 4915200
200460296 DeadlyPillow F2 April 2, 2023, 5:37 p.m. OK GNU C++17 TESTS 119 608 1740800
200498416 pop_count F2 April 3, 2023, 3:11 a.m. OK GNU C++17 TESTS 119 639 1024000
200502117 Aging1986 F2 April 3, 2023, 4:19 a.m. OK GNU C++17 TESTS 119 1185 1638400
200502363 Hritik12 F2 April 3, 2023, 4:23 a.m. OK GNU C++17 TESTS 119 1232 1638400
200457775 potato167 F2 April 2, 2023, 5:24 p.m. OK GNU C++17 TESTS 119 1403 7987200
200459735 DeadlyPillow F2 April 2, 2023, 5:34 p.m. OK GNU C++17 TESTS 119 1513 3481600
200480697 bitoy F2 April 2, 2023, 8:59 p.m. OK GNU C++17 TESTS 119 1528 10444800
200500363 HeiYeTang F2 April 3, 2023, 3:48 a.m. OK GNU C++17 TESTS 119 1622 6451200
200522132 try_kuhn F2 April 3, 2023, 5:56 a.m. OK GNU C++17 TESTS 119 2995 1843200
200482145 michao F2 April 2, 2023, 9:19 p.m. OK GNU C++17 (64) TESTS 119 904 1740800
200520349 BeyondHeaven F2 April 3, 2023, 5:45 a.m. OK GNU C++17 (64) TESTS 119 1450 187801600
200456585 maspy F2 April 2, 2023, 5:20 p.m. OK GNU C++20 (64) TESTS 119 373 8806400
200458522 RDDCCD F2 April 2, 2023, 5:28 p.m. OK GNU C++20 (64) TESTS 119 452 10854400
200521940 ayushnew_7 F2 April 3, 2023, 5:53 a.m. OK GNU C++20 (64) TESTS 119 468 921600
200478432 GOD_0F_DEATH F2 April 2, 2023, 8:35 p.m. OK GNU C++20 (64) TESTS 119 483 1740800
200468972 heno239 F2 April 2, 2023, 6:47 p.m. OK GNU C++20 (64) TESTS 119 514 11571200
200478085 GOD_0F_DEATH F2 April 2, 2023, 8:30 p.m. OK GNU C++20 (64) TESTS 119 561 3276800
200487351 triveni F2 April 2, 2023, 10:44 p.m. OK GNU C++20 (64) TESTS 119 577 819200
200507174 Tweetuzki F2 April 3, 2023, 5:19 a.m. OK GNU C++20 (64) TESTS 119 577 1638400
200477991 GOD_0F_DEATH F2 April 2, 2023, 8:29 p.m. OK GNU C++20 (64) TESTS 119 577 3276800
200478731 GOD_0F_DEATH F2 April 2, 2023, 8:38 p.m. OK GNU C++20 (64) TESTS 119 592 9830400
200498113 dzhi F2 April 3, 2023, 3:05 a.m. OK Java 11 TESTS 119 1856 4096000
200522506 Remineva F2 April 3, 2023, 6:02 a.m. OK PyPy 3-64 TESTS 119 1341 32051200

remove filters

Back to search problems