Kotlin Heroes: Practice 8

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
1570 Kotlin Heroes: Practice 8 FINISHED False 518400 143310323 Oct. 1, 2021, 1:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 20 ) H Chainword PROGRAMMING *special data structures strings

A chainword is a special type of crossword. As most of the crosswords do, it has cells that you put the letters in and some sort of hints to what these letters should be. The letter cells in a chainword are put in a single row. We will consider chainwords of length (m) in this task. A hint to a chainword is a sequence of segments such that the segments don't intersect with each other and cover all (m) letter cells. Each segment contains a description of the word in the corresponding cells. The twist is that there are actually two hints: one sequence is the row above the letter cells and the other sequence is the row below the letter cells. When the sequences are different, they provide a way to resolve the ambiguity in the answers. You are provided with a dictionary of (n) words, each word consists of lowercase Latin letters. All words are pairwise distinct. An instance of a chainword is the following triple: a string of (m) lowercase Latin letters; the first hint: a sequence of segments such that the letters that correspond to each segment spell a word from the dictionary; the second hint: another sequence of segments such that the letters that correspond to each segment spell a word from the dictionary. Note that the sequences of segments don't necessarily have to be distinct. Two instances of chainwords are considered different if they have different strings, different first hints or different second hints. Count the number of different instances of chainwords. Since the number might be pretty large, output it modulo (998\,244\,353). The first line contains two integers (n) and (m) ((1 \le n \le 8), (1 \le m \le 10^9)) — the number of words in the dictionary and the number of letter cells. Each of the next (n) lines contains a word — a non-empty string of no more than (5) lowercase Latin letters. All words are pairwise distinct. Print a single integer — the number of different instances of chainwords of length

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
130598503 Golovanov399 H Oct. 2, 2021, 8:36 p.m. OK Kotlin 1.4 TESTS 44 187 25907200
131031235 prabith H Oct. 7, 2021, 5:19 a.m. OK Kotlin 1.4 TESTS 44 904 22220800
130816617 ushmitadutta H Oct. 4, 2021, 3:06 p.m. OK Kotlin 1.4 TESTS 44 920 22220800
131093985 armoking H Oct. 7, 2021, 5:54 p.m. OK Kotlin 1.4 TESTS 44 951 22220800
130488952 Borsalino1006 H Oct. 1, 2021, 5:04 p.m. OK Kotlin 1.4 TESTS 44 2823 24064000
131010468 Fortin H Oct. 6, 2021, 7:40 p.m. OK Kotlin 1.4 TESTS 44 3197 22118400
130600343 jimm89 H Oct. 2, 2021, 9:17 p.m. OK Kotlin 1.4 TESTS 44 3400 23040000
131006057 Fortin H Oct. 6, 2021, 6:23 p.m. OK Kotlin 1.4 TESTS 44 3665 21913600
130484020 natsugiri H Oct. 1, 2021, 4:11 p.m. OK Kotlin 1.4 TESTS 44 3712 22630400
130582310 Noam13 H Oct. 2, 2021, 4:21 p.m. OK Kotlin 1.4 TESTS 44 3743 22220800
130971863 davidgarcia H Oct. 6, 2021, 11:39 a.m. OK Kotlin 1.5 TESTS 44 1013 27136000
131005934 Fortin H Oct. 6, 2021, 6:21 p.m. OK Kotlin 1.5 TESTS 44 3759 26009600
130585689 tabr H Oct. 2, 2021, 5:06 p.m. OK Kotlin 1.5 TESTS 44 4882 26726400
131038632 yudedako H Oct. 7, 2021, 7:07 a.m. OK Kotlin 1.5 TESTS 44 5209 27750400
131036295 yudedako H Oct. 7, 2021, 6:36 a.m. OK Kotlin 1.5 TESTS 44 5755 27750400
131017224 lightseba H Oct. 6, 2021, 10:30 p.m. OK Kotlin 1.5 TESTS 44 5942 27750400

remove filters

Back to search problems