Codeforces Round 851 (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
1788 Codeforces Round 851 (Div. 2) FINISHED False 7200 61226663 Feb. 9, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4030 ) D Moving Dots PROGRAMMING binary search brute force combinatorics dp math two pointers

B'We play a game with n dots on a number line. The initial coordinate of the i -th dot is x_i . These coordinates are distinct. Every dot starts moving simultaneously with the same constant speed. Each dot moves in the direction of the closest dot (different from itself) until it meets another dot. In the case of a tie, it goes to the left. Two dots meet if they are in the same coordinate, after that, they stop moving. After enough time, every dot stops moving. The result of a game is the number of distinct coordinates where the dots stop. Because this game is too easy, calculate the sum of results when we play the game for every subset of the given n dots that has at least two dots. As the result can be very large, print the sum modulo 10^9+7 . The first line contains one integer n ( 2 <= q n <= q 3000 ). The next line contains n integers x_1, x_2, ldots, x_n ( 1 <= q x_1 < x_2 < ldots < x_n <= q 10^9 ), where x_i represents the initial coordinate of i -th dot. Print the sum of results modulo 10^9+7 . In the first example, for a subset of size 2 , two dots move toward each other, so there is 1 coordinate where the dots stop. For a subset of size 3 , the first dot and third dot move toward the second dot, so there is 1 coordinate where the dots stop no matter the direction where the second dot moves. For [1, 2, 4, 6] , the first and second dots move toward each other. For the third dot, initially, the second dot and the fourth dot are the closest dots. Since it is a tie, the third dot moves left. The fourth dot also moves left. So there is 1 coordinate where the dots stop, which is 1.5 . Because there are 6 subsets of size 2 , 4 subsets of size 3 and one subset of size 4 , the answer is 6 cdot 1 + 4 cdot 1 + 1 = 11 . In the second example, for a subset of size 5 (when there are dots at 1 , 3 , 5 '...

Tutorials

Codeforces Round #851 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
193018329 Liswiera D Feb. 10, 2023, 5:35 a.m. OK C# 10 TESTS 50 452 512000
192967449 Tdyx D Feb. 9, 2023, 5:26 p.m. OK C# 10 TESTS 50 499 77619200
193001238 Awesome3.14 D Feb. 10, 2023, 12:38 a.m. OK D TESTS 50 327 4403200
192969050 KrowSavcik D Feb. 9, 2023, 5:34 p.m. OK GNU C11 TESTS 50 280 102400
193003242 yxzy D Feb. 10, 2023, 1:32 a.m. OK GNU C++14 TESTS 50 78 0
193018938 you_xiao D Feb. 10, 2023, 5:42 a.m. OK GNU C++14 TESTS 50 93 0
193013901 1250713087 D Feb. 10, 2023, 4:40 a.m. OK GNU C++14 TESTS 50 93 102400
193015682 LXH-cat D Feb. 10, 2023, 5:04 a.m. OK GNU C++14 TESTS 50 108 72294400
193009245 Steve_Tu D Feb. 10, 2023, 3:29 a.m. OK GNU C++14 TESTS 50 109 0
193005091 OMG_78 D Feb. 10, 2023, 2:16 a.m. OK GNU C++14 TESTS 50 109 102400
193010069 broshen D Feb. 10, 2023, 3:43 a.m. OK GNU C++14 TESTS 50 109 102400
192988757 KiFaH_HeLaL D Feb. 9, 2023, 8:29 p.m. OK GNU C++14 TESTS 50 109 819200
193004782 Xeniarahc D Feb. 10, 2023, 2:10 a.m. OK GNU C++14 TESTS 50 109 4812800
193013994 1250713087 D Feb. 10, 2023, 4:41 a.m. OK GNU C++14 TESTS 50 124 102400
192968924 Jihyo D Feb. 9, 2023, 5:34 p.m. OK GNU C++17 TESTS 50 62 0
193000469 LOL_I_AM_SERZH D Feb. 10, 2023, 12:16 a.m. OK GNU C++17 TESTS 50 77 0
192967824 unbengable D Feb. 9, 2023, 5:27 p.m. OK GNU C++17 TESTS 50 78 0
192991080 lxyb D Feb. 9, 2023, 9:01 p.m. OK GNU C++17 TESTS 50 78 102400
193017422 handsome_Lee66 D Feb. 10, 2023, 5:24 a.m. OK GNU C++17 TESTS 50 93 0
193005869 lavijiang D Feb. 10, 2023, 2:32 a.m. OK GNU C++17 TESTS 50 93 0
192995465 ptrju D Feb. 9, 2023, 10:14 p.m. OK GNU C++17 TESTS 50 93 0
192976578 vrobert D Feb. 9, 2023, 6:27 p.m. OK GNU C++17 TESTS 50 93 0
192976336 regain0001 D Feb. 9, 2023, 6:25 p.m. OK GNU C++17 TESTS 50 93 0
193018956 SF-Manman D Feb. 10, 2023, 5:42 a.m. OK GNU C++17 TESTS 50 93 0
192984021 enslaved D Feb. 9, 2023, 7:35 p.m. OK GNU C++17 (64) TESTS 50 62 0
193000343 kuchibi D Feb. 10, 2023, 12:13 a.m. OK GNU C++17 (64) TESTS 50 62 0
192987288 amenotiomoi D Feb. 9, 2023, 8:12 p.m. OK GNU C++17 (64) TESTS 50 62 102400
193010306 Sempr D Feb. 10, 2023, 3:47 a.m. OK GNU C++17 (64) TESTS 50 62 204800
193015081 korokseeds D Feb. 10, 2023, 4:56 a.m. OK GNU C++17 (64) TESTS 50 62 307200
193015178 tomYYDS D Feb. 10, 2023, 4:57 a.m. OK GNU C++17 (64) TESTS 50 62 16076800
192965495 stan23456 D Feb. 9, 2023, 5:18 p.m. OK GNU C++17 (64) TESTS 50 78 102400
192967737 lee0560 D Feb. 9, 2023, 5:27 p.m. OK GNU C++17 (64) TESTS 50 155 157081600
193009197 Followall D Feb. 10, 2023, 3:29 a.m. OK GNU C++17 (64) TESTS 50 171 0
192965285 Absurd_ D Feb. 9, 2023, 5:17 p.m. OK GNU C++17 (64) TESTS 50 218 102400
193017667 Whiteqwq D Feb. 10, 2023, 5:27 a.m. OK GNU C++20 (64) TESTS 50 46 0
193017268 Aoisrot D Feb. 10, 2023, 5:22 a.m. OK GNU C++20 (64) TESTS 50 46 102400
193007125 wj123_ D Feb. 10, 2023, 2:54 a.m. OK GNU C++20 (64) TESTS 50 61 16076800
193018943 anf4108 D Feb. 10, 2023, 5:42 a.m. OK GNU C++20 (64) TESTS 50 62 0
193018149 shash4321 D Feb. 10, 2023, 5:33 a.m. OK GNU C++20 (64) TESTS 50 62 0
193016835 Silencer76 D Feb. 10, 2023, 5:17 a.m. OK GNU C++20 (64) TESTS 50 62 0
193020531 Saanteye D Feb. 10, 2023, 5:59 a.m. OK GNU C++20 (64) TESTS 50 62 0
193007314 qhnana7mi D Feb. 10, 2023, 2:57 a.m. OK GNU C++20 (64) TESTS 50 62 0
193006765 bigJ D Feb. 10, 2023, 2:47 a.m. OK GNU C++20 (64) TESTS 50 62 0
193016139 elManco D Feb. 10, 2023, 5:10 a.m. OK GNU C++20 (64) TESTS 50 62 0
192967980 profchi D Feb. 9, 2023, 5:28 p.m. OK Java 11 TESTS 50 1029 307200
193002593 dzhi D Feb. 10, 2023, 1:14 a.m. OK Java 11 TESTS 50 1107 614400
193004522 frey4 D Feb. 10, 2023, 2:04 a.m. OK Java 17 TESTS 50 311 2355200
192982270 merlin_ D Feb. 9, 2023, 7:19 p.m. OK Java 17 TESTS 50 498 1843200
193008614 kkz666 D Feb. 10, 2023, 3:20 a.m. OK Java 17 TESTS 50 576 82022400
192958950 Anu_Jha D Feb. 9, 2023, 4:29 p.m. OK Java 17 TESTS 50 1309 2048000
192961298 megaspazz D Feb. 9, 2023, 4:33 p.m. OK Java 8 TESTS 50 311 0
193002827 Socrates1232 D Feb. 10, 2023, 1:21 a.m. OK Java 8 TESTS 50 686 0
192960905 gaju_01 D Feb. 9, 2023, 4:33 p.m. OK Java 8 TESTS 50 1060 102400
192971763 shehebe D Feb. 9, 2023, 5:52 p.m. OK PyPy 3 TESTS 50 343 3993600
193018313 hkwu6013 D Feb. 10, 2023, 5:35 a.m. OK PyPy 3 TESTS 50 421 40857600
193012627 broshen D Feb. 10, 2023, 4:23 a.m. OK PyPy 3 TESTS 50 483 3993600
193000476 AadiS D Feb. 10, 2023, 12:16 a.m. OK PyPy 3 TESTS 50 1122 5120000
192998930 SoleProprietor D Feb. 9, 2023, 11:33 p.m. OK PyPy 3-64 TESTS 50 218 5120000
193007280 gardengnome D Feb. 10, 2023, 2:57 a.m. OK PyPy 3-64 TESTS 50 249 5017600
192958778 ItsLastDay D Feb. 9, 2023, 4:29 p.m. OK PyPy 3-64 TESTS 50 249 5324800
192979868 Martial D Feb. 9, 2023, 6:56 p.m. OK PyPy 3-64 TESTS 50 264 9011200
192985033 NP_Prob D Feb. 9, 2023, 7:46 p.m. OK PyPy 3-64 TESTS 50 451 133017600
192965699 1_2_3_4_5_9 D Feb. 9, 2023, 5:18 p.m. OK PyPy 3-64 TESTS 50 764 13516800
192991864 Alex239 D Feb. 9, 2023, 9:13 p.m. OK PyPy 3-64 TESTS 50 810 8294400
193002429 plevande D Feb. 10, 2023, 1:10 a.m. OK PyPy 3-64 TESTS 50 811 9318400
192984681 SophieHatter D Feb. 9, 2023, 7:42 p.m. OK PyPy 3-64 TESTS 50 982 8806400
192983115 SophieHatter D Feb. 9, 2023, 7:27 p.m. OK PyPy 3-64 TESTS 50 1029 9011200
193004612 bqn D Feb. 10, 2023, 2:06 a.m. OK Rust 2021 TESTS 50 265 614400
192966475 bqn D Feb. 9, 2023, 5:21 p.m. OK Rust 2021 TESTS 50 483 102400

remove filters

Back to search problems