CodeTON Round 3 (Div. 1 + Div. 2, Rated, Prizes!)

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
1750 CodeTON Round 3 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 9000 64077899 Nov. 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 249 ) G Doping PROGRAMMING dp dp math math

B"We call an array a of length n fancy if for each 1 < i <= n it holds that a_i = a_{i-1} + 1 . Let's call f(p) applied to a permutation ^ dagger of length n as the minimum number of subarrays it can be partitioned such that each one of them is fancy. For example f([1,2,3]) = 1 , while f([3,1,2]) = 2 and f([3,2,1]) = 3 . Given n and a permutation p of length n , we define a permutation p' of length n to be k -special if and only if: Your task is to count for each 1 <= k <= n the number of k -special permutations modulo m . ^ dagger A permutation is an array consisting 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). ^ ddagger A permutation a of length n is lexicographically smaller than a permutation b of length n if and only if the following holds: in the first position where a and b differ, the permutation a has a smaller element than the corresponding element in b . The first line contains two integers n and m ( 1 <= n <= 2000 , 10 <= m <= 10^9 ) -- the length of the permutation and the required modulo. The second line contains n distinct integers p_1, p_2, ldots, p_n ( 1 <= p_i <= n ) -- the permutation p . Print n integers, where the k -th integer is the number of k -special permutations modulo m . In the first example, the permutations that are lexicographically smaller than [1,3,4,2] are: Thus our answer is [1,0,1,1] . In the second example, the permutations that are lexicographically smaller than [3,2,1] are: Thus our answer is [1,2,2] . "...

Tutorials

CodeTON Round 3 (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
179823657 rainboy G Nov. 6, 2022, 9:06 p.m. OK GNU C11 TESTS 49 124 16076800
179839927 universe_dawn G Nov. 7, 2022, 2:17 a.m. OK GNU C++14 TESTS 50 171 51200000
179645973 ABitstOCHASTIC G Nov. 6, 2022, 5 p.m. OK GNU C++14 TESTS 49 1918 109977600
179645932 danxmz2006 G Nov. 6, 2022, 5 p.m. OK GNU C++17 TESTS 49 77 32256000
179815467 Wailydest G Nov. 6, 2022, 7:04 p.m. OK GNU C++17 TESTS 49 109 32256000
179711152 noob2004 G Nov. 6, 2022, 5:43 p.m. OK GNU C++17 TESTS 49 1231 242380800
179707183 Ormlis G Nov. 6, 2022, 5:42 p.m. OK GNU C++17 (64) TESTS 49 93 32460800
179623473 WYZFL G Nov. 6, 2022, 4:30 p.m. OK GNU C++17 (64) TESTS 49 109 32256000
179618975 zh0ukangyang G Nov. 6, 2022, 4:11 p.m. OK GNU C++17 (64) TESTS 49 109 100556800
179622344 kiwikiwi G Nov. 6, 2022, 4:26 p.m. OK GNU C++17 (64) TESTS 49 140 64921600
179633580 Nyaan G Nov. 6, 2022, 4:58 p.m. OK GNU C++17 (64) TESTS 49 234 32768000
179838286 sabbirahmeds877 G Nov. 7, 2022, 1:43 a.m. OK GNU C++20 (64) TESTS 50 171 32256000
179621065 feecIe6418 G Nov. 6, 2022, 4:20 p.m. OK GNU C++20 (64) TESTS 49 187 32256000
179829123 oleh1421 G Nov. 6, 2022, 11:15 p.m. OK GNU C++20 (64) TESTS 49 218 129638400
179828979 oleh1421 G Nov. 6, 2022, 11:10 p.m. OK GNU C++20 (64) TESTS 49 295 129638400
179708728 IamPOOR_help_me G Nov. 6, 2022, 5:42 p.m. OK GNU C++20 (64) TESTS 49 405 26828800
179614248 flowerletter G Nov. 6, 2022, 3:52 p.m. OK GNU C++20 (64) TESTS 49 405 32460800
179633214 p_b_p_b G Nov. 6, 2022, 4:56 p.m. OK GNU C++20 (64) TESTS 49 514 87347200
179658799 conqueror_of_tourist G Nov. 6, 2022, 5:04 p.m. OK PyPy 3-64 TESTS 49 342 64409600

remove filters

Back to search problems