Kotlin Heroes: Episode 1

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
1170 Kotlin Heroes: Episode 1 FINISHED False 9000 178385087 May 28, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 476 ) D Decoding of Integer Sequences PROGRAMMING *special data structures implementation

B'Polycarp is developing a method for transmitting n integer sequences over a network. This method should support the transmission of an arbitrary number of integer sequences; sequences can have different lengths. The sequences contain arbitrary non-negative integers. Polycarp developed the following encoding procedure: For example, if you want to encode three sequences [3, 1, 4] , [2, 7] and [1, 2, 3, 4] , then the sequence of actions will be as follows: Your task is to implement decoding by a given encoding result. The first line contains integer number m ( 1 <= m <= 3 cdot10^5 ), denoting the length of the encoding result. The second line contains the result of encoding as a sequence of integers b_1, b_2, ... , b_m ( -1 <= b_i <= 100 ). It is guaranteed that in the initial sequences before encoding contains only non-negative integers from 0 to 100 , that you are in fact given the result of correct encoding (in other words, it is guaranteed that the answer exists). It is possible that one or more initial sequences were empty before encoding. Print n , where n is the number of encoded sequences. Then print n lines in the format k_i, a_{i1}, a_{i2}, ... , a_{ik_i} , where k_i is the length of the i -th sequence, and a_{i1}, a_{i2}, ... , a_{ik_i} are its elements. Separate the numbers in the lines with spaces. Please note that the encoding procedure is such that every possible encoding result can be decoded in only one way. '...

Tutorials

Kotlin Heroes Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
54756305 Petr D May 28, 2019, 2:52 p.m. OK Kotlin TESTS 17 170 2662400
54765212 bohuss D May 28, 2019, 4:56 p.m. OK Kotlin TESTS 17 186 9216000
55610787 ReaLNero1 D June 16, 2019, 5:35 a.m. OK Kotlin TESTS 17 218 9216000
59902571 liouzhou_101 D Sept. 2, 2019, 2:10 p.m. OK Kotlin TESTS 17 218 17203200
54759080 DeadPillow D May 28, 2019, 3:25 p.m. OK Kotlin TESTS 17 233 21504000
54757223 300iq D May 28, 2019, 3:02 p.m. OK Kotlin TESTS 17 233 22323200
54756756 eatmore D May 28, 2019, 2:57 p.m. OK Kotlin TESTS 17 249 19865600
54758038 xiaowuc1 D May 28, 2019, 3:13 p.m. OK Kotlin TESTS 17 249 21299200
54778388 alexey.enkov D May 28, 2019, 7:28 p.m. OK Kotlin TESTS 17 249 21913600
54760739 wleung_bvg D May 28, 2019, 3:47 p.m. OK Kotlin TESTS 17 249 22732800

remove filters

Back to search problems