Kotlin Heroes: Episode 10

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
1958 Kotlin Heroes: Episode 10 FINISHED False 9000 21569063 May 13, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 278 ) E Yet Another Permutation Constructive PROGRAMMING *special constructive algorithms 1900

B"Suppose you have a permutation p of n integers -- an array where each element is an integer from 1 to n , and every integer from 1 to n appears exactly once. In one operation, you remove every element of this permutation which is less than at least one of its neighbors. For example, when you apply the operation to [3, 1, 2, 5, 4] , you get [3, 5] . If you apply an operation again, you get [5] . It's easy to see that after applying a finite number of operations, you get an array consisting of a single integer n . You are given two integers n and k . Find a permutation of n integers such that it becomes an array consisting of a single element n after exactly k operations (and not earlier). The first line contains one integer t ( 1 <= t <= 2000 ) -- the number of test cases. Each test case consists of one line containing two integers n and k ( 2 <= n <= 100 ; 1 <= k <= n - 1 ). For each test case, print the answer as follows: "...

Tutorials

129483

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
260946582 semenInRussia E May 14, 2024, 3:14 p.m. OK Kotlin 1.7 TESTS 9 327 18329600 1900
260945315 Sumitsingh7 E May 14, 2024, 3:03 p.m. OK Kotlin 1.7 TESTS 9 327 18329600 1900
260899078 abusaeed2433 E May 14, 2024, 8:43 a.m. OK Kotlin 1.7 TESTS 9 343 8499200 1900
260820420 MagentaCobra E May 13, 2024, 3:13 p.m. OK Kotlin 1.7 TESTS 9 374 16281600 1900
260834436 Saarth E May 13, 2024, 4:58 p.m. OK Kotlin 1.7 TESTS 9 389 37990400 1900
260910209 mysteriocoder E May 14, 2024, 10:27 a.m. OK Kotlin 1.7 TESTS 9 390 66560000 1900
260818482 pashka E May 13, 2024, 3 p.m. OK Kotlin 1.7 TESTS 9 405 31641600 1900
260818706 tabr E May 13, 2024, 3:02 p.m. OK Kotlin 1.7 TESTS 9 405 49152000 1900
260844785 IshwarSuthar E May 13, 2024, 6:35 p.m. OK Kotlin 1.7 TESTS 9 406 36761600 1900
260820367 WiwiHo E May 13, 2024, 3:13 p.m. OK Kotlin 1.7 TESTS 9 421 34918400 1900
260819559 knightL E May 13, 2024, 3:07 p.m. OK Kotlin 1.9 TESTS 9 186 1228800 1900
260822997 AkaiLemon E May 13, 2024, 3:32 p.m. OK Kotlin 1.9 TESTS 9 187 1126400 1900
260828674 MassimoG E May 13, 2024, 4:13 p.m. OK Kotlin 1.9 TESTS 9 202 102400 1900
260822200 JoseSoto E May 13, 2024, 3:26 p.m. OK Kotlin 1.9 TESTS 9 202 102400 1900
260822356 nickyfoo E May 13, 2024, 3:27 p.m. OK Kotlin 1.9 TESTS 9 202 204800 1900
260819310 Kude E May 13, 2024, 3:06 p.m. OK Kotlin 1.9 TESTS 9 202 204800 1900
260823917 _Fake4Fun E May 13, 2024, 3:39 p.m. OK Kotlin 1.9 TESTS 9 202 1228800 1900
261716727 y4n9b0 E May 20, 2024, 3:13 a.m. OK Kotlin 1.9 TESTS 9 202 1843200 1900
261458575 Yuvraj_2004 E May 18, 2024, 4:46 a.m. OK Kotlin 1.9 TESTS 9 202 1945600 1900
260826730 dzhi E May 13, 2024, 3:59 p.m. OK Kotlin 1.9 TESTS 9 203 0 1900

remove filters

Back to search problems