Kotlin Heroes: Episode 7

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
1533 Kotlin Heroes: Episode 7 FINISHED False 9000 106845899 June 29, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 84 ) H Submatrices PROGRAMMING *special bitmasks data structures dp

B'You are given matrix s that contains n rows and m columns. Each element of a matrix is one of the 5 first Latin letters (in upper case). For each k ( 1 <= k <= 5 ) calculate the number of submatrices that contain exactly k different letters. Recall that a submatrix of matrix s is a matrix that can be obtained from s after removing several (possibly zero) first rows, several (possibly zero) last rows, several (possibly zero) first columns, and several (possibly zero) last columns. If some submatrix can be obtained from s in two or more ways, you have to count this submatrix the corresponding number of times. The first line contains two integers n and m ( 1 <= n, m <= 800 ). Then n lines follow, each containing the string s_i ( |s_i| = m ) -- i -th row of the matrix. For each k ( 1 <= k <= 5 ) print one integer -- the number of submatrices that contain exactly k different letters. '...

Tutorials

Kotlin Heroes 7 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
120893602 eatmore H June 29, 2021, 4:11 p.m. OK Kotlin TESTS 46 436 0
120896468 SYury H June 29, 2021, 4:44 p.m. OK Kotlin TESTS 46 498 8396800
120898041 insert_cool_handle H June 29, 2021, 5:02 p.m. OK Kotlin TESTS 46 546 0
120897415 nuip H June 29, 2021, 4:55 p.m. OK Kotlin TESTS 46 560 102400
120920532 b2jena H June 30, 2021, 4:12 a.m. OK Kotlin TESTS 46 561 0
120896407 DeadPillow H June 29, 2021, 4:43 p.m. OK Kotlin TESTS 46 576 0
120888686 Petr H June 29, 2021, 3:19 p.m. OK Kotlin TESTS 46 577 0
120890022 tourist H June 29, 2021, 3:31 p.m. OK Kotlin TESTS 46 608 1740800
120900234 nor H June 29, 2021, 5:32 p.m. OK Kotlin TESTS 46 623 0
120891131 Fortin H June 29, 2021, 3:43 p.m. OK Kotlin TESTS 46 654 0

remove filters

Back to search problems