Kotlin Heroes: Episode 14

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
2199 Kotlin Heroes: Episode 14 FINISHED False 9000 3943523 March 2, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 382 ) C Minesweeper PROGRAMMING *special constructive algorithms greedy

You need to construct a field for the game "Minesweeper" consisting of (2) rows and several columns. Each cell must either be empty or contain a mine. We say that two cells are neighboring if they share a side and/or a corner . The field you are constructing must satisfy the following constraints: each empty cell must be neighboring at most one mine; the number of empty cells that have a neighboring cell with a mine is equal to (k); among all suitable fields, the number of columns must be the minimum possible. Construct such a field or report that it is impossible. The first line contains one integer (t) ((1 \le t \le 100)) — the number of test cases. Each test case consists of one line containing one integer (k) ((1 \le k \le 100)) — the required number of empty cells which have a neighboring cell with a mine. For each test case, output the answer as follows: if it is impossible to construct a field that satisfies all constraints, print NO ; otherwise, on the first line print YES , and on the second line print an integer (n), where (n) is the minimum number of columns in the field. On the third and fourth lines, print the description of the field itself. The description of each row of the field must consist of (n) characters, each of which is either a dot " . " (empty cell) or an asterisk " * " (mine). If there are multiple suitable fields, output any of them.

Tutorials

151783

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
365169655 GodFather_8 C March 3, 2026, 4:59 a.m. OK Kotlin 1.7 TESTS 3 156 0
365103305 tokitsukaze C March 2, 2026, 2:50 p.m. OK Kotlin 1.7 TESTS 3 156 0
365107513 HinaSnow C March 2, 2026, 3:16 p.m. OK Kotlin 1.7 TESTS 3 156 102400
365111113 shushant24 C March 2, 2026, 3:40 p.m. OK Kotlin 1.7 TESTS 3 171 0
365110682 VishalMaurya0 C March 2, 2026, 3:37 p.m. OK Kotlin 1.7 TESTS 3 171 0
365105845 sunyike C March 2, 2026, 3:05 p.m. OK Kotlin 1.7 TESTS 3 171 0
365104956 anirudh_08 C March 2, 2026, 2:59 p.m. OK Kotlin 1.7 TESTS 3 171 0
365104674 Duskshard C March 2, 2026, 2:58 p.m. OK Kotlin 1.7 TESTS 3 171 0
365108858 ujjawalmishra816 C March 2, 2026, 3:25 p.m. OK Kotlin 1.7 TESTS 3 171 102400
365108009 yatuoximeng C March 2, 2026, 3:19 p.m. OK Kotlin 1.7 TESTS 3 171 409600
365108664 1435730 C March 2, 2026, 3:23 p.m. OK Kotlin 1.9 TESTS 3 93 0
365108300 hocln C March 2, 2026, 3:21 p.m. OK Kotlin 1.9 TESTS 3 93 0
365106687 zornlemma C March 2, 2026, 3:11 p.m. OK Kotlin 1.9 TESTS 3 93 0
365104990 wu_qing C March 2, 2026, 3 p.m. OK Kotlin 1.9 TESTS 3 93 0
365103122 __jk__ C March 2, 2026, 2:49 p.m. OK Kotlin 1.9 TESTS 3 93 0
365146356 yuisgame C March 2, 2026, 9:10 p.m. OK Kotlin 1.9 TESTS 3 109 0
365116999 jinxedcat C March 2, 2026, 4:26 p.m. OK Kotlin 1.9 TESTS 3 109 0
365107509 snnr C March 2, 2026, 3:16 p.m. OK Kotlin 1.9 TESTS 3 109 0
365106804 BERNARB.01 C March 2, 2026, 3:11 p.m. OK Kotlin 1.9 TESTS 3 109 0
365104497 varlevani C March 2, 2026, 2:57 p.m. OK Kotlin 1.9 TESTS 3 109 0
365113368 WaterSpellbinder C March 2, 2026, 3:56 p.m. OK Kotlin 2.2 TESTS 3 62 0
365136427 Professor_4 C March 2, 2026, 7:11 p.m. OK Kotlin 2.2 TESTS 3 78 0
365118396 TesLaNot C March 2, 2026, 4:37 p.m. OK Kotlin 2.2 TESTS 3 78 0
365108299 BluoCaroot C March 2, 2026, 3:21 p.m. OK Kotlin 2.2 TESTS 3 78 0
365105167 conjectureguy C March 2, 2026, 3:01 p.m. OK Kotlin 2.2 TESTS 3 78 0
365104567 NVadim C March 2, 2026, 2:57 p.m. OK Kotlin 2.2 TESTS 3 78 0
365103484 Fysty C March 2, 2026, 2:51 p.m. OK Kotlin 2.2 TESTS 3 78 0
365109667 derSamat C March 2, 2026, 3:30 p.m. OK Kotlin 2.2 TESTS 3 78 204800
365112210 LakhimpurKheri C March 2, 2026, 3:48 p.m. OK Kotlin 2.2 TESTS 3 78 23654400
365106207 sahudebankumar C March 2, 2026, 3:08 p.m. OK Kotlin 2.2 TESTS 3 78 23859200

remove filters

Back to search problems