Kotlin Heroes: Episode 9 (Unrated, T-Shirts + 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
1910 Kotlin Heroes: Episode 9 (Unrated, T-Shirts + Prizes!) FINISHED False 9000 34874663 Dec. 11, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 52 ) I Inverse Problem PROGRAMMING *special combinatorics dp

B'Consider the following problem. You are given a string s , consisting of n lowercase Latin letters, and an integer k ( n is not divisible by k ). Each letter is one of the first c letters of the alphabet. You apply the following operation until the length of the string is less than k : choose a contiguous substring of the string of length exactly k , remove it from the string and glue the resulting parts together without changing the order. Let the resulting string of length smaller than k be t . What is lexicographically smallest string t that can obtained? You are asked the inverse of this problem. Given two integers n and k ( n is not divisible by k ) and a string t , consisting of ( n bmod k ) lowercase Latin letters, count the number of strings s that produce t as the lexicographically smallest solution. Print that number modulo 998 ,244 ,353 . The first line contains three integers n, k and c ( 1 <= n <= 10^6 ; 2 <= k <= 10^6 ; 1 <= c <= 26 ; n is not divisible by k ) -- the length of string s , the length of the substring that is being removed and the number of first letters from the alphabet. The second line contains string t , consisting of exactly ( n bmod k ) lowercase Latin letters. Each letter is one of the first c letters of the alphabet. Print a single integer -- the number of strings s that produce t as the lexicographically smallest solution. The strings s in the first example: "aaa", "aab", "aba", "abb", "baa", "bba". The strings s in the second example: "bcabc", "bcacc", "bcbbc", "bcbcc", "bccbc", "bcccc", "caabc", "cabbc", "cacbc", "cbabc", "cbbbc", "cbcbc", "ccabc", "ccbbc", "cccbc". '...

Tutorials

123261

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
236844210 cmk666 I Dec. 12, 2023, 1:22 a.m. OK Kotlin 1.7 TESTS 16 404 60518400
236804140 arvindf232 I Dec. 11, 2023, 3:53 p.m. OK Kotlin 1.7 TESTS 16 420 19558400
236836307 chappy1 I Dec. 11, 2023, 9:31 p.m. OK Kotlin 1.7 TESTS 16 608 23142400
236832098 Potassium I Dec. 11, 2023, 8:23 p.m. OK Kotlin 1.7 TESTS 16 732 131788800
236812032 pashka I Dec. 11, 2023, 4:52 p.m. OK Kotlin 1.7 TESTS 16 811 268390400
236850948 Benq I Dec. 12, 2023, 4:02 a.m. OK Kotlin 1.9 TESTS 16 421 145305600
236806001 tourist I Dec. 11, 2023, 4:06 p.m. OK Kotlin 1.9 TESTS 16 452 9113600
236811652 Kude I Dec. 11, 2023, 4:50 p.m. OK Kotlin 1.9 TESTS 16 529 11980800
236822810 cabbit I Dec. 11, 2023, 6:30 p.m. OK Kotlin 1.9 TESTS 16 545 35532800
236809162 Tlatoani I Dec. 11, 2023, 4:30 p.m. OK Kotlin 1.9 TESTS 16 702 22732800

remove filters

Back to search problems