Kotlin Heroes: Episode 10

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
1958 Kotlin Heroes: Episode 10 FINISHED False 9000 21569063 May 13, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 209 ) F Narrow Paths PROGRAMMING *special combinatorics 2000

B"Monocarp is wandering through a matrix consisting of 2 rows and n columns. Let's denote the cell in the i -th row and j -th column as (i, j) . Monocarp starts at cell (1, 1) and wants to reach cell (2, n) . In one move, Monocarp can move in one of two directions: Monocarp can't go outside the matrix. Polycarp wants to prevent Monocarp from freely wandering through the matrix. To do this, he wants to choose exactly k different cells in the matrix and block them. He cannot choose cells (1, 1) and (2, n) . For each i from 0 to n , Polycarp wants to know how many ways he can block exactly k cells, so that Monocarp has exactly i different paths from (1, 1) to (2, n) . Two paths are considered different if there exists a cell that Monocarp visits in one path but not in the other. As the number of ways can be quite large, output it modulo 10^9 + 7 . The only line contains two integers n and k ( 2 <= n <= 2 cdot 10^5 ; 2 <= k <= 2 cdot n - 2 ) -- the number of columns in the matrix and the number of cells Polycarp wants to block. Output n + 1 integers: for each i from 0 to n , the number of ways to block exactly k cells, so that Monocarp has exactly i different paths from (1, 1) to (2, n) . Output all answers modulo 10^9 + 7 . "...

Tutorials

129483

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
262887610 mallicktariq F May 27, 2024, 1:30 p.m. OK Kotlin 1.7 TESTS 22 421 33792000 2000
260824862 MagentaCobra F May 13, 2024, 3:46 p.m. OK Kotlin 1.7 TESTS 22 437 27136000 2000
261250263 Sumitsingh7 F May 16, 2024, 8:17 p.m. OK Kotlin 1.7 TESTS 22 437 28160000 2000
260828005 Romy67 F May 13, 2024, 4:08 p.m. OK Kotlin 1.7 TESTS 22 483 48332800 2000
260830072 Alpha_Q F May 13, 2024, 4:23 p.m. OK Kotlin 1.7 TESTS 22 483 77516800 2000
261318616 chappy1 F May 17, 2024, 11:12 a.m. OK Kotlin 1.7 TESTS 22 484 67276800 2000
260829250 Phantom_Deluxe F May 13, 2024, 4:17 p.m. OK Kotlin 1.7 TESTS 22 514 43008000 2000
260830217 Anupam_Ghosh F May 13, 2024, 4:24 p.m. OK Kotlin 1.7 TESTS 22 514 75059200 2000
260825523 Bedge F May 13, 2024, 3:50 p.m. OK Kotlin 1.7 TESTS 22 515 68198400 2000
262021601 Slata F May 21, 2024, 1:05 p.m. OK Kotlin 1.7 TESTS 22 561 43622400 2000
260881103 Sparkle_Twilight F May 14, 2024, 5:41 a.m. OK Kotlin 1.9 TESTS 22 218 4505600 2000
260828188 _Fake4Fun F May 13, 2024, 4:09 p.m. OK Kotlin 1.9 TESTS 22 233 0 2000
260874200 dzhi F May 14, 2024, 4 a.m. OK Kotlin 1.9 TESTS 22 233 4505600 2000
260838380 pchel F May 13, 2024, 5:37 p.m. OK Kotlin 1.9 TESTS 22 234 7475200 2000
260822729 thenymphsofdelphi F May 13, 2024, 3:30 p.m. OK Kotlin 1.9 TESTS 22 249 0 2000
261081916 Aniket_001 F May 15, 2024, 4:33 p.m. OK Kotlin 1.9 TESTS 22 249 7577600 2000
260825212 AkaiLemon F May 13, 2024, 3:48 p.m. OK Kotlin 1.9 TESTS 22 249 11161600 2000
260820245 uwi F May 13, 2024, 3:12 p.m. OK Kotlin 1.9 TESTS 22 265 1740800 2000
261300757 Yuvraj_2004 F May 17, 2024, 8:41 a.m. OK Kotlin 1.9 TESTS 22 265 7577600 2000
260821916 nuip F May 13, 2024, 3:24 p.m. OK Kotlin 1.9 TESTS 22 265 10240000 2000

remove filters

Back to search problems