Codeforces Round 777 (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
1647 Codeforces Round 777 (Div. 2) FINISHED False 7200 90257063 March 11, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 468 ) F Madoka and Laziness PROGRAMMING dp greedy

B"Madoka has become too lazy to write a legend, so let's go straight to the formal description of the problem. An array of integers a_1, a_2, ldots, a_n is called a hill if it is not empty and there is an index i in it, for which the following is true: a_1 < a_2 < ldots < a_i > a_{i + 1} > a_{i + 2} > ldots > a_n . A sequence x is a subsequence of a sequence y if x can be obtained from y by deletion of several (possibly, zero or all) elements keeping the order of the other elements. For example, for an array [69, 1000, 228, -7] the array [1000, -7] is a subsequence, while [1] and [-7, 1000] are not. Splitting an array into two subsequences is called good if each element belongs to exactly one subsequence, and also each of these subsequences is a hill. You are given an array of distinct positive integers a_1, a_2, ldots a_n . It is required to find the number of different pairs of maxima of the first and second subsequences among all good splits. Two pairs that only differ in the order of elements are considered same. The first line of input contains a single integer n ( 2 <= n <= 5 cdot 10^5 ) -- array size. The second line of input contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ) -- the elements of the array. It is guaranteed that all a_i are pairwise distinct. In a single line, print exactly one number -- the number of different pairs of maxima of the first and second subsequences among all good splits. In the first test case there are 3 possible pairs: (3, 4) , (2, 4) , (1, 4) . And they are achieved with the following partitions: [1, 2, 3], [4] ; [4, 3], [1, 2] ; [1], [2, 4, 3] "...

Tutorials

Codeforces Round #777 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
149366511 Tyyyyyy F March 12, 2022, 1:56 a.m. OK GNU C++14 TESTS 31 124 10035200
149366104 vjudge5 F March 12, 2022, 1:46 a.m. OK GNU C++14 TESTS 31 124 10035200
149366026 L7-56 F March 12, 2022, 1:44 a.m. OK GNU C++14 TESTS 31 140 10035200
149367827 Suiseiseki F March 12, 2022, 2:25 a.m. OK GNU C++14 TESTS 31 202 26726400
149374998 QuangBuiCP F March 12, 2022, 4:22 a.m. OK GNU C++17 TESTS 31 140 3993600
149361770 YaoBIG F March 11, 2022, 10:48 p.m. OK GNU C++17 TESTS 31 156 10035200
149321927 kshitij_sodani F March 11, 2022, 4:30 p.m. OK GNU C++17 TESTS 31 186 20070400
149350227 TankEngineer F March 11, 2022, 7:12 p.m. OK GNU C++17 TESTS 31 202 21299200
149368107 xyf007 F March 12, 2022, 2:31 a.m. OK GNU C++17 (64) TESTS 31 31 11059200
149367823 xyf007 F March 12, 2022, 2:25 a.m. OK GNU C++17 (64) TESTS 31 93 10035200
149363909 neal F March 12, 2022, 12:36 a.m. OK GNU C++17 (64) TESTS 31 108 7987200
149314609 I_Love_LE F March 11, 2022, 4:10 p.m. OK GNU C++17 (64) TESTS 31 108 12083200
149364035 neal F March 12, 2022, 12:40 a.m. OK GNU C++17 (64) TESTS 31 109 7987200
149323443 errorgorn F March 11, 2022, 4:33 p.m. OK GNU C++17 (64) TESTS 31 109 20070400
149362315 kal013 F March 11, 2022, 11:33 p.m. OK GNU C++17 (64) TESTS 31 140 3993600
149364542 Nero F March 12, 2022, 12:59 a.m. OK GNU C++20 (64) TESTS 31 78 10035200
149327718 Brovko F March 11, 2022, 4:52 p.m. OK GNU C++20 (64) TESTS 31 78 10035200
149368416 kmjp F March 12, 2022, 2:37 a.m. OK GNU C++20 (64) TESTS 31 78 10137600
149355590 Bench0310 F March 11, 2022, 8:25 p.m. OK GNU C++20 (64) TESTS 31 93 3993600
149353429 dean.menezes F March 11, 2022, 7:52 p.m. OK GNU C++20 (64) TESTS 31 93 12083200
149319974 Heltion F March 11, 2022, 4:25 p.m. OK GNU C++20 (64) TESTS 31 108 12083200
149327631 SomethingNew F March 11, 2022, 4:51 p.m. OK GNU C++20 (64) TESTS 31 109 12083200
149332634 maspy F March 11, 2022, 5:14 p.m. OK GNU C++20 (64) TESTS 31 124 33075200
149364165 blackbird137 F March 12, 2022, 12:45 a.m. OK GNU C++20 (64) TESTS 31 171 10035200
149371664 realRainFestivalqwq F March 12, 2022, 3:22 a.m. OK GNU C++20 (64) TESTS 31 421 9932800

remove filters

Back to search problems