Codeforces Round 745 (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
1580 Codeforces Round 745 (Div. 1) FINISHED False 7200 104269463 Sept. 30, 2021, 10:15 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1080 ) B Mathematics Curriculum PROGRAMMING combinatorics dp trees 2600

B"Let c_1, c_2, ldots, c_n be a permutation of integers 1, 2, ldots, n . Consider all subsegments of this permutation containing an integer x . Given an integer m , we call the integer x good if there are exactly m different values of maximum on these subsegments. Cirno is studying mathematics, and the teacher asks her to count the number of permutations of length n with exactly k good numbers. Unfortunately, Cirno isn't good at mathematics, and she can't answer this question. Therefore, she asks you for help. Since the answer may be very big, you only need to tell her the number of permutations modulo p . 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). A sequence a is a subsegment of a sequence b if a can be obtained from b by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. The first line contains four integers n, m, k, p ( 1 <= n <= 100, 1 <= m <= n, 1 <= k <= n, 1 <= p <= 10^9 ). Output the number of permutations modulo p . In the first test case, there are four permutations: [1, 3, 2, 4] , [2, 3, 1, 4] , [4, 1, 3, 2] and [4, 2, 3, 1] . Take permutation [1, 3, 2, 4] as an example: For number 1 , all subsegments containing it are: [1] , [1, 3] , [1, 3, 2] and [1, 3, 2, 4] , and there're three different maxima 1 , 3 and 4 . Similarly, for number 3 , there're two different maxima 3 and 4 . For number 2 , there're three different maxima 2 , 3 and 4 . And for number 4 , there're only one, that is "...

Tutorials

Codeforces Round #745 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
130430125 XueYJ B Oct. 1, 2021, 4:51 a.m. OK GNU C++14 TESTS 46 93 8396800 2600
130429687 _xyj B Oct. 1, 2021, 4:42 a.m. OK GNU C++14 TESTS 46 93 8396800 2600
130375295 djq_fpc B Sept. 30, 2021, 1 p.m. OK GNU C++14 TESTS 42 187 3891200 2600
130370586 djq_fpc B Sept. 30, 2021, 12:14 p.m. OK GNU C++14 TESTS 40 202 3891200 2600
130422829 2919805063 B Oct. 1, 2021, 2:05 a.m. OK GNU C++14 TESTS 45 202 8601600 2600
130422816 2919805063 B Oct. 1, 2021, 2:04 a.m. OK GNU C++14 TESTS 45 202 8601600 2600
130355204 MofK B Sept. 30, 2021, 11:14 a.m. OK GNU C++14 TESTS 40 218 9420800 2600
130389105 xyf007 B Sept. 30, 2021, 3:10 p.m. OK GNU C++14 TESTS 44 249 8089600 2600
130377372 CXY07 B Sept. 30, 2021, 1:19 p.m. OK GNU C++14 TESTS 42 280 14540800 2600
130424768 xiaoziyao B Oct. 1, 2021, 2:54 a.m. OK GNU C++14 TESTS 45 312 8396800 2600
130355243 nick452 B Sept. 30, 2021, 11:14 a.m. OK GNU C++17 TESTS 40 61 12390400 2600
130423039 YeongTree B Oct. 1, 2021, 2:11 a.m. OK GNU C++17 TESTS 45 78 8396800 2600
130423008 YeongTree B Oct. 1, 2021, 2:10 a.m. OK GNU C++17 TESTS 45 93 8396800 2600
130412516 jerdno B Sept. 30, 2021, 8:03 p.m. OK GNU C++17 TESTS 45 93 8396800 2600
130412487 jerdno B Sept. 30, 2021, 8:02 p.m. OK GNU C++17 TESTS 45 93 8396800 2600
130420726 zhangguangxuan99 B Oct. 1, 2021, 12:27 a.m. OK GNU C++17 TESTS 45 139 10444800 2600
130408509 0x24 B Sept. 30, 2021, 6:56 p.m. OK GNU C++17 TESTS 45 140 12083200 2600
130423580 XiKanDaoShuQianChongLang B Oct. 1, 2021, 2:26 a.m. OK GNU C++17 TESTS 45 202 14233600 2600
130389077 xyf007 B Sept. 30, 2021, 3:09 p.m. OK GNU C++17 TESTS 44 249 8089600 2600
130389274 xyf007 B Sept. 30, 2021, 3:12 p.m. OK GNU C++17 TESTS 44 264 8089600 2600
130421713 Life.1s.Suck B Oct. 1, 2021, 1:27 a.m. OK GNU C++17 (64) TESTS 45 93 9011200 2600
130343157 maroonrk B Sept. 30, 2021, 10:35 a.m. OK GNU C++17 (64) TESTS 40 93 9830400 2600
130412893 dendi239 B Sept. 30, 2021, 8:09 p.m. OK GNU C++17 (64) TESTS 45 109 4403200 2600
130412732 dendi239 B Sept. 30, 2021, 8:06 p.m. OK GNU C++17 (64) TESTS 45 109 4403200 2600
130412316 dendi239 B Sept. 30, 2021, 7:59 p.m. OK GNU C++17 (64) TESTS 45 109 4403200 2600
130412294 dendi239 B Sept. 30, 2021, 7:59 p.m. OK GNU C++17 (64) TESTS 45 109 4403200 2600
130412209 dendi239 B Sept. 30, 2021, 7:57 p.m. OK GNU C++17 (64) TESTS 45 109 4403200 2600
130412129 dendi239 B Sept. 30, 2021, 7:56 p.m. OK GNU C++17 (64) TESTS 45 109 4403200 2600
130422767 OIerwanhong B Oct. 1, 2021, 2:03 a.m. OK GNU C++17 (64) TESTS 45 109 4505600 2600
130411073 dendi239 B Sept. 30, 2021, 7:37 p.m. OK GNU C++17 (64) TESTS 45 109 4505600 2600
130357834 uwi B Sept. 30, 2021, 11:24 a.m. OK Java 11 TESTS 40 951 23961600 2600
130374567 kobae964 B Sept. 30, 2021, 12:54 p.m. OK Rust TESTS 41 1777 4812800 2600
130376459 kobae964 B Sept. 30, 2021, 1:10 p.m. OK Rust TESTS 42 1794 4608000 2600

remove filters

Back to search problems