Harbour.Space Scholarship Contest 2021-2022 (open for everyone, rated, Div. 1 + 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
1553 Harbour.Space Scholarship Contest 2021-2022 (open for everyone, rated, Div. 1 + Div. 2) FINISHED False 9000 104858699 July 22, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 205 ) I Stairs PROGRAMMING combinatorics divide and conquer fft math

B'For a permutation p of numbers 1 through n , we define a stair array a as follows: a_i is length of the longest segment of permutation which contains position i and is made of consecutive values in sorted order: [x, x+1, ldots, y-1, y] or [y, y-1, ldots, x+1, x] for some x <= q y . For example, for permutation p = [4, 1, 2, 3, 7, 6, 5] we have a = [1, 3, 3, 3, 3, 3, 3] . You are given the stair array a . Your task is to calculate the number of permutations which have stair array equal to a . Since the number can be big, compute it modulo 998 ,244 ,353 . Note that this number can be equal to zero. The first line of input contains integer n ( 1 <= n <= 10^5 ) -- the length of a stair array a . The second line of input contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ). Print the number of permutations which have stair array equal to a . Since the number can be big, compute it modulo 998 ,244 ,353 . '...

Tutorials

Harbour.Space Scholarship Contest 2021-2022 (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
123365580 Salley-Garden I July 22, 2021, 8:26 p.m. OK GNU C++11 TESTS 56 1700 83968000
123367407 q-w-q-w-q I July 22, 2021, 9 p.m. OK GNU C++11 TESTS 56 1715 83968000
123356669 gisp_zjz I July 22, 2021, 6:41 p.m. OK GNU C++11 TESTS 56 4273 28979200
123373718 yhx-12243 I July 23, 2021, 12:06 a.m. OK GNU C++17 TESTS 56 982 113868800
123347924 ksun48 I July 22, 2021, 4:53 p.m. OK GNU C++17 TESTS 56 5521 25702400
123385111 Benq I July 23, 2021, 3:33 a.m. OK GNU C++17 (64) TESTS 56 187 24371200
123365596 Salley-Garden I July 22, 2021, 8:26 p.m. OK GNU C++17 (64) TESTS 56 420 88678400
123356051 Nyaan I July 22, 2021, 6:37 p.m. OK GNU C++17 (64) TESTS 56 530 78336000
123356230 Nyaan I July 22, 2021, 6:38 p.m. OK GNU C++17 (64) TESTS 56 545 78336000
123365100 risujiroh I July 22, 2021, 8:17 p.m. OK GNU C++17 (64) TESTS 56 608 26419200
123396361 sh1194 I July 23, 2021, 6:02 a.m. OK GNU C++17 (64) TESTS 56 639 73216000
123395789 sh1194 I July 23, 2021, 5:55 a.m. OK GNU C++17 (64) TESTS 56 654 73216000
123346691 yosupo I July 22, 2021, 4:48 p.m. OK GNU C++17 (64) TESTS 56 655 14643200
123396284 sh1194 I July 23, 2021, 6:01 a.m. OK GNU C++17 (64) TESTS 56 655 73216000
123356766 rainboy I July 22, 2021, 6:42 p.m. OK GNU C++17 (64) TESTS 56 655 73216000

remove filters

Back to search problems