Codeforces Round 814 (Div. 1)

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
1718 Codeforces Round 814 (Div. 1) FINISHED False 7200 76519463 Aug. 16, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 317 ) D Permutation for Burenka PROGRAMMING greedy math trees

B"We call an array a pure if all elements in it are pairwise distinct. For example, an array [1, 7, 9] is pure, [1, 3, 3, 7] isn't, because 3 occurs twice in it. A pure array b is similar to a pure array c if their lengths n are the same and for all pairs of indices l , r , such that 1 <= l <= r <= n , it's true that operatorname{argmax}([b_l, b_{l + 1}, ldots, b_r]) = operatorname{argmax}([c_l, c_{l + 1}, ldots, c_r]), where operatorname{argmax}(x) is defined as the index of the largest element in x (which is unique for pure arrays). For example, operatorname{argmax}([3, 4, 2]) = 2 , operatorname{argmax}([1337, 179, 57]) = 1 . Recently, Tonya found out that Burenka really likes a permutation p of length n . Tonya decided to please her and give her an array a similar to p . He already fixed some elements of a , but exactly k elements are missing (in these positions temporarily a_i = 0 ). It is guaranteed that k ge 2 . Also, he has a set S of k - 1 numbers. Tonya realized that he was missing one number to fill the empty places of a , so he decided to buy it. He has q options to buy. Tonya thinks that the number d suits him, if it is possible to replace all zeros in a with numbers from S and the number d , so that a becomes a pure array similar to p . For each option of d , output whether this number is suitable for him or not. The first line contains a single integer t ( 1 <= t <= 10^4 ) is the number of test cases. The description of the test cases follows. The first line of each test case contains a couple of integers n and q ( 1 <= n, q <= 3 cdot 10^5 ). The second line of each input test case contains n integers p_1, p_2, ldots, p_n ( 1 <= p_i <= n ) -- the permutation Burenka likes. The third line of"...

Tutorials

Codeforces Round #814 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
168592506 Mr_Eight D Aug. 16, 2022, 4:20 p.m. OK GNU C++14 TESTS 81 405 24064000
168597359 djq_fpc D Aug. 16, 2022, 4:29 p.m. OK GNU C++14 TESTS 81 717 107520000
168578771 Radewoosh D Aug. 16, 2022, 3:55 p.m. OK GNU C++17 TESTS 81 763 58572800
168597231 noimi D Aug. 16, 2022, 4:29 p.m. OK GNU C++17 (64) TESTS 81 405 38092800
168599605 God_Of_Blunder D Aug. 16, 2022, 4:32 p.m. OK GNU C++17 (64) TESTS 81 452 75161600
168609520 353cerega D Aug. 16, 2022, 5:59 p.m. OK GNU C++17 (64) TESTS 81 592 157286400
168590948 TLEwpdus D Aug. 16, 2022, 4:18 p.m. OK GNU C++17 (64) TESTS 81 748 21401600
168587794 LJC00118 D Aug. 16, 2022, 4:12 p.m. OK GNU C++17 (64) TESTS 81 1700 58470400
168655507 maxplus D Aug. 17, 2022, 6:03 a.m. OK GNU C++20 (64) TESTS 81 93 22425600
168651016 maxplus D Aug. 17, 2022, 5:06 a.m. OK GNU C++20 (64) TESTS 81 93 22425600
168654358 maxplus D Aug. 17, 2022, 5:50 a.m. OK GNU C++20 (64) TESTS 81 109 22425600
168650988 maxplus D Aug. 17, 2022, 5:05 a.m. OK GNU C++20 (64) TESTS 81 109 22425600
168646402 maxplus D Aug. 17, 2022, 3:56 a.m. OK GNU C++20 (64) TESTS 81 295 25292800
168582453 ecnerwala D Aug. 16, 2022, 4:02 p.m. OK GNU C++20 (64) TESTS 81 296 21708800
168647672 maxplus D Aug. 17, 2022, 4:17 a.m. OK GNU C++20 (64) TESTS 81 296 32972800
168646167 maxplus D Aug. 17, 2022, 3:52 a.m. OK GNU C++20 (64) TESTS 81 311 28876800
168645390 maxplus D Aug. 17, 2022, 3:40 a.m. OK GNU C++20 (64) TESTS 81 311 45158400
168628675 maxplus D Aug. 16, 2022, 9:50 p.m. OK GNU C++20 (64) TESTS 81 311 45158400

remove filters

Back to search problems