Kotlin Heroes: Episode 13

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
2141 Kotlin Heroes: Episode 13 FINISHED False 9000 18717923 Sept. 12, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 342 ) C Minimum on Subarrays PROGRAMMING *special brute force

There is a variable (sum), which is initially equal to (0). There is also a data structure that can perform the following operations: pushback x — adds an element with value (x) to the end of the structure; pushfront x — adds an element with value (x) to the beginning of the structure; popback — removes the last element from the structure; popfront — removes the first element from the structure; min — adds the value of the minimum element currently in the structure to the variable (sum). The operations popback , popfront , and min cannot be applied to an empty structure! Using this structure, you would like to be able to find the sum of the minimums of all non-empty subarrays of an array (a) of (n) elements. More formally, your task is to find a sequence of no more than (n \cdot (n + 2)) commands such that after all operations, the variable (sum) will be equal to (\sum_{0 \le l \le r < n} \min(al,\dots, ar)) for any possible array (a). The first line contains a single integer (n) ((1 \le n \le 500)) — the number of elements in the array. Output (k) ((1 \le k \le n \cdot (n + 2))) commands. Each command must be one of the following five lines: " pushback ai ", where (i) — a number from (0) to (n - 1) " pushfront ai ", where (i) — a number from (0) to (n - 1) " popback " " popfront " " min " If there are multiple valid answers, output any.

Tutorials

Kotlin Heroes 13 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
338242719 sabhinsv C Sept. 12, 2025, 4:26 p.m. OK Kotlin 1.7 TESTS 15 327 5734400
338232185 mistborn2005 C Sept. 12, 2025, 3:19 p.m. OK Kotlin 1.7 TESTS 15 327 7475200
338228683 manhmkl87 C Sept. 12, 2025, 2:59 p.m. OK Kotlin 1.7 TESTS 15 327 10956800
338228388 WiwiHo C Sept. 12, 2025, 2:58 p.m. OK Kotlin 1.7 TESTS 15 343 7884800
338237926 IMAN_GH C Sept. 12, 2025, 3:53 p.m. OK Kotlin 1.7 TESTS 15 343 11673600
338232595 Hikari_Nguyen C Sept. 12, 2025, 3:21 p.m. OK Kotlin 1.7 TESTS 15 358 20377600
338226837 lethan3 C Sept. 12, 2025, 2:50 p.m. OK Kotlin 1.7 TESTS 15 359 10035200
338240614 Iamheretocode C Sept. 12, 2025, 4:12 p.m. OK Kotlin 1.7 TESTS 15 374 7270400
338229574 ram.bhakt C Sept. 12, 2025, 3:04 p.m. OK Kotlin 1.7 TESTS 15 390 44953600
338275820 VaHiX C Sept. 12, 2025, 10:12 p.m. OK Kotlin 1.7 TESTS 15 405 10547200
338230770 Intellegent C Sept. 12, 2025, 3:11 p.m. OK Kotlin 1.9 TESTS 15 140 4505600
338232328 mm944 C Sept. 12, 2025, 3:20 p.m. OK Kotlin 1.9 TESTS 15 155 4710400
338242265 Seonggwon C Sept. 12, 2025, 4:23 p.m. OK Kotlin 1.9 TESTS 15 156 3584000
338234627 MagicalGirl C Sept. 12, 2025, 3:33 p.m. OK Kotlin 1.9 TESTS 15 171 1331200
338231150 __jk__ C Sept. 12, 2025, 3:13 p.m. OK Kotlin 1.9 TESTS 15 171 2662400
338227466 MohamedSaeed C Sept. 12, 2025, 2:53 p.m. OK Kotlin 1.9 TESTS 15 171 3584000
338229163 gleb.astashkin C Sept. 12, 2025, 3:02 p.m. OK Kotlin 1.9 TESTS 15 186 4505600
338229776 MDelPiero C Sept. 12, 2025, 3:05 p.m. OK Kotlin 1.9 TESTS 15 186 8294400
338232491 alexey.enkov C Sept. 12, 2025, 3:21 p.m. OK Kotlin 1.9 TESTS 15 187 2560000
338231771 NHiL C Sept. 12, 2025, 3:16 p.m. OK Kotlin 1.9 TESTS 15 202 1945600
338232011 O3_Tester C Sept. 12, 2025, 3:18 p.m. OK Kotlin 2.2 TESTS 15 155 4403200
338226028 Tlatoani C Sept. 12, 2025, 2:46 p.m. OK Kotlin 2.2 TESTS 15 171 3686400
338234009 jagbarrameda C Sept. 12, 2025, 3:30 p.m. OK Kotlin 2.2 TESTS 15 171 4505600
338235086 OpGm C Sept. 12, 2025, 3:36 p.m. OK Kotlin 2.2 TESTS 15 186 0
338231735 chromate00 C Sept. 12, 2025, 3:16 p.m. OK Kotlin 2.2 TESTS 15 186 1536000
338231103 jbnbjbckc C Sept. 12, 2025, 3:13 p.m. OK Kotlin 2.2 TESTS 15 186 3788800
338282866 Hoang_Thien_De C Sept. 13, 2025, 1:08 a.m. OK Kotlin 2.2 TESTS 15 186 8396800
338234364 binminh01 C Sept. 12, 2025, 3:32 p.m. OK Kotlin 2.2 TESTS 15 187 0
338227384 lto5 C Sept. 12, 2025, 2:52 p.m. OK Kotlin 2.2 TESTS 15 187 0
338238753 maximxls C Sept. 12, 2025, 3:59 p.m. OK Kotlin 2.2 TESTS 15 187 4198400

remove filters

Back to search problems