Kotlin Heroes 5: ICPC Round

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
1431 Kotlin Heroes 5: ICPC Round FINISHED False 9000 132161111 Nov. 12, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 46 ) I Cyclic Shifts PROGRAMMING *special strings

B"You are given a matrix consisting of n rows and m columns. The matrix contains lowercase letters of the Latin alphabet. You can perform the following operation any number of times you want to: choose two integers i ( 1 <= i <= m ) and k ( 0 < k < n ), and shift every column j such that i <= j <= m cyclically by k . The shift is performed upwards. For example, if you have a matrix You have to process q queries. Each of the queries is a string of length m consisting of lowercase letters of the Latin alphabet. For each query, you have to calculate the minimum number of operations described above you have to perform so that at least one row of the matrix is equal to the string from the query. Note that all queries are independent, that is, the operations you perform in a query don't affect the initial matrix in other queries. The first line contains three integers n , m , q ( 2 <= n, m, q <= 2.5 cdot 10^5 ; n cdot m <= 5 cdot 10^5 ; q cdot m <= 5 cdot 10^5 ) -- the number of rows and columns in the matrix and the number of queries, respectively. The next n lines contains m lowercase Latin letters each -- elements of the matrix. The following q lines contains a description of queries -- strings of length m consisting of lowercase letters of the Latin alphabet. Print q integers. The i -th integer should be equal to the minimum number of operations you have to perform so that the matrix contains a string from the i -th query or -1 if the specified string cannot be obtained. "...

Tutorials

84563

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
98219660 eatmore I Nov. 12, 2020, 4:36 p.m. OK Kotlin TESTS 168 530 11980800
98235466 timf1089 I Nov. 12, 2020, 10:33 p.m. OK Kotlin TESTS 168 623 170598400
98246488 sh1194 I Nov. 13, 2020, 5:19 a.m. OK Kotlin TESTS 168 764 20377600
98246563 sh1194 I Nov. 13, 2020, 5:21 a.m. OK Kotlin TESTS 168 795 20377600
98221635 natsugiri I Nov. 12, 2020, 5:01 p.m. OK Kotlin TESTS 168 810 20377600
98224431 ainta I Nov. 12, 2020, 5:43 p.m. OK Kotlin TESTS 168 951 31436800
98236811 Bench0310 I Nov. 12, 2020, 11:41 p.m. OK Kotlin TESTS 168 1419 161792000
98218966 tourist I Nov. 12, 2020, 4:27 p.m. OK Kotlin TESTS 168 1856 81920000
98221527 Geothermal I Nov. 12, 2020, 4:59 p.m. OK Kotlin TESTS 168 1887 126464000
98236585 Bench0310 I Nov. 12, 2020, 11:29 p.m. OK Kotlin TESTS 168 1887 322252800

remove filters

Back to search problems