Kotlin Heroes: Episode 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
1571 Kotlin Heroes: Episode 8 FINISHED False 9900 98205899 Oct. 7, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 380 ) C Rhyme PROGRAMMING *special implementation

B"Let's say that two strings s and t rhyme if both strings have length at least k , and their last k characters are equal. For example, if k = 3 , the strings abcd and cebcd rhyme, the strings ab and ab don't rhyme, the strings aaaa and aaaaa rhyme, the strings abcd and abce don't rhyme. You have n pairs of strings (s_i, t_i) , and for each pair of strings you know, should they rhyme or should not. Find all possible non-negative integer values for k such that pairs that have to rhyme, rhyme and pairs that must not rhyme, don't rhyme. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the number of string pairs. Next n lines contains descriptions of pairs -- one per line. The i -th line contains space-separated strings s_i and t_i and marker r_i . Strings are non-empty, consist of lowercase Latin letters and each have length at most 2 cdot 10^5 . The marker r_i equals to 1 if strings have to rhyme, or 0 if they must not rhyme. It's guaranteed that for each test case there is at least one pair with r_i equal to 1 and that the total length of all strings over all test cases doesn't exceed 4 cdot 10^5 . For each test case, firstly print integer m -- the number of possible non-negative integer values of k such that pairs that have to rhyme, rhyme and pairs that must not rhyme, don't rhyme. Next, print all these values of k (without repetitions). You can print them in any order. In the first test case, if k is at least 1 then kotlin and heroes don't rhyme. In the second test case, for k = 2 join and kotlin rhyme, and episode and eight don't rhyme. "...

Tutorials

Kotlin Heroes 8 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131079097 eatmore C Oct. 7, 2021, 2:52 p.m. OK Kotlin 1.4 TESTS 9 140 20582400
131079233 Ra16bit C Oct. 7, 2021, 2:53 p.m. OK Kotlin 1.4 TESTS 9 140 20787200
131078907 armoking C Oct. 7, 2021, 2:50 p.m. OK Kotlin 1.4 TESTS 9 155 20684800
131080685 Arrias C Oct. 7, 2021, 3:05 p.m. OK Kotlin 1.4 TESTS 9 155 20992000
131086168 SlowLegendaryNoobMaster C Oct. 7, 2021, 3:53 p.m. OK Kotlin 1.4 TESTS 9 155 23142400
131078273 xiaowuc1 C Oct. 7, 2021, 2:46 p.m. OK Kotlin 1.4 TESTS 9 156 20684800
131095206 ostroumov C Oct. 7, 2021, 6:14 p.m. OK Kotlin 1.4 TESTS 9 171 21811200
131081163 songsinger C Oct. 7, 2021, 3:09 p.m. OK Kotlin 1.4 TESTS 9 171 26726400
131078896 Fortin C Oct. 7, 2021, 2:50 p.m. OK Kotlin 1.4 TESTS 9 186 20787200
131082601 HavlongRG C Oct. 7, 2021, 3:21 p.m. OK Kotlin 1.4 TESTS 9 186 21811200
131079071 Egor C Oct. 7, 2021, 2:52 p.m. OK Kotlin 1.5 TESTS 9 202 24883200
131079690 bobib C Oct. 7, 2021, 2:57 p.m. OK Kotlin 1.5 TESTS 9 217 24883200
131079036 arvindf232 C Oct. 7, 2021, 2:51 p.m. OK Kotlin 1.5 TESTS 9 233 24985600
131097849 ankushkhanna C Oct. 7, 2021, 7:01 p.m. OK Kotlin 1.5 TESTS 9 249 25804800
131079560 alexey.enkov C Oct. 7, 2021, 2:56 p.m. OK Kotlin 1.5 TESTS 9 264 25702400
131078595 lightseba C Oct. 7, 2021, 2:48 p.m. OK Kotlin 1.5 TESTS 9 265 25395200
131079044 uwi C Oct. 7, 2021, 2:52 p.m. OK Kotlin 1.5 TESTS 9 280 25497600
131080011 Roll_Num_56 C Oct. 7, 2021, 2:59 p.m. OK Kotlin 1.5 TESTS 9 311 30515200
131088501 achilleus C Oct. 7, 2021, 4:21 p.m. OK Kotlin 1.5 TESTS 9 326 25804800
131086018 bohuss C Oct. 7, 2021, 3:52 p.m. OK Kotlin 1.5 TESTS 9 326 25907200

remove filters

Back to search problems