Codeforces Round 911 (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
1900 Codeforces Round 911 (Div. 2) FINISHED False 7200 36170663 Nov. 26, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 300 ) F Local Deletions PROGRAMMING data structures implementation

B'For an array b_1, b_2, ldots, b_m , for some i ( 1 < i < m ), element b_i is said to be a local minimum if b_i < b_{i-1} and b_i < b_{i+1} . Element b_1 is said to be a local minimum if b_1 < b_2 . Element b_m is said to be a local minimum if b_m < b_{m-1} . For an array b_1, b_2, ldots, b_m , for some i ( 1 < i < m ), element b_i is said to be a local maximum if b_i > b_{i-1} and b_i > b_{i+1} . Element b_1 is said to be a local maximum if b_1 > b_2 . Element b_m is said to be a local maximum if b_m > b_{m-1} . Let x be an array of distinct elements. We define two operations on it: Define f(x) as follows. Repeat operations 1, 2, 1, 2, ldots in that order until you get only one element left in the array. Return that element. For example, take an array [1,3,2] . We will first do type 1 operation and get [1, 2] . Then we will perform type 2 operation and get [2] . Therefore, f([1,3,2]) = 2 . You are given a permutation ^ dagger a of size n and q queries. Each query consists of two integers l and r such that 1 <= l <= r <= n . The query asks you to compute f([a_l, a_{l+1}, ldots, a_r]) . ^ dagger A permutation of length n is an array 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). The first line contains two integers n and q ( 1 <= n, q <= 10^5 ) -- the length of the permutation a and the number of queries. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- the elements of permutation a . The i -th of the next q l'...

Tutorials

Codeforces Round 911 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
234488804 superguymj F Nov. 26, 2023, 5:46 p.m. OK GNU C++14 TESTS 85 186 18022400
234513459 TMK.17 F Nov. 26, 2023, 9:01 p.m. OK GNU C++14 TESTS 85 1294 4608000

remove filters

Back to search problems