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
( 659 ) C Poisonous Swamp PROGRAMMING *special *special implementation implementation

B'The first location in the brand new critically acclaimed fantasy action RPG "Ancient Staff" is a poisonous swamp. The swamp has some lily pads growing in it. It can be represented as a 2 x n grid ( 2 rows and n columns), where each cell is either empty or has a lily pad in it. There are exactly n lily pads in a swamp -- one in each column. A frog is sitting on top of every lily pad. In one move, every frog must jump to an adjacent by a side cell. After the move, no frog can be outside the grid and no two frogs can share the same lily pad. Two frogs from adjacent cells can 't jump towards each other (i.e. swap cells). If a frog jumps to a lily pad, it survives. Otherwise, it falls into a poisonous swamp and gets devoured by an eldritch creature living on its bottom. You can choose the direction each frogs jumps at. Determine the maximum number of frogs that can survive after one move. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of the testcase contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of columns in a swamp grid. Each of the following two lines contains a description of a row of a swamp -- a string, consisting of exactly n characters. Each character is either a dot ( '. '), denoting a swamp cell, or an asterisk ( '* '), denoting a lily pad with a frog. In each column, there is exactly one dot and exactly one asterisk. The sum of n over all testcases doesn 't exceed 2 cdot 10^5 . For each testcase, print a single integer -- the maximum number of frogs that can survive after one move, if you choose the direction each frogs jumps at. The i -th frog is the frog on the lily pad in the i -th column. In the first testcase: '...

Tutorials

123261

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
236799907 cftauros C Dec. 11, 2023, 3:25 p.m. OK Kotlin 1.7 TESTS 11 264 716800
236794066 MagentaCobra C Dec. 11, 2023, 2:53 p.m. OK Kotlin 1.7 TESTS 11 280 11571200
236793138 tabr C Dec. 11, 2023, 2:48 p.m. OK Kotlin 1.7 TESTS 11 296 2457600
236793361 pashka C Dec. 11, 2023, 2:49 p.m. OK Kotlin 1.7 TESTS 11 311 5939200
236793491 arvindf232 C Dec. 11, 2023, 2:50 p.m. OK Kotlin 1.7 TESTS 11 311 7680000
236793940 Hakiobo C Dec. 11, 2023, 2:52 p.m. OK Kotlin 1.7 TESTS 11 326 409600
236792091 xiaowuc1 C Dec. 11, 2023, 2:44 p.m. OK Kotlin 1.7 TESTS 11 326 5324800
236794101 Fortin C Dec. 11, 2023, 2:53 p.m. OK Kotlin 1.7 TESTS 11 326 24985600
236808500 nigus C Dec. 11, 2023, 4:25 p.m. OK Kotlin 1.7 TESTS 11 343 4710400
236804242 Subhashis_CSE C Dec. 11, 2023, 3:54 p.m. OK Kotlin 1.7 TESTS 11 358 9728000
236810849 _Anton C Dec. 11, 2023, 4:43 p.m. OK Kotlin 1.9 TESTS 11 295 3379200
236803361 T_PAVAN_NAGARAJU C Dec. 11, 2023, 3:47 p.m. OK Kotlin 1.9 TESTS 11 296 8294400
236793660 Valera_Grinenko C Dec. 11, 2023, 2:51 p.m. OK Kotlin 1.9 TESTS 11 296 9113600
236794245 thenymphsofdelphi C Dec. 11, 2023, 2:54 p.m. OK Kotlin 1.9 TESTS 11 311 6041600
236799401 MateuszPietrzak C Dec. 11, 2023, 3:22 p.m. OK Kotlin 1.9 TESTS 11 311 7782400
236793977 Spheniscine C Dec. 11, 2023, 2:52 p.m. OK Kotlin 1.9 TESTS 11 312 4915200
236793256 jvmusin C Dec. 11, 2023, 2:49 p.m. OK Kotlin 1.9 TESTS 11 327 6758400
236793253 DeadlyPillow C Dec. 11, 2023, 2:49 p.m. OK Kotlin 1.9 TESTS 11 327 11776000
236801668 outlander C Dec. 11, 2023, 3:36 p.m. OK Kotlin 1.9 TESTS 11 358 6656000
236793930 koboshi C Dec. 11, 2023, 2:52 p.m. OK Kotlin 1.9 TESTS 11 358 7475200

remove filters

Back to search problems