subject

Assume that someone dictates you a sequence of numbers and you need to write it down. for brevity, he dictates it as follows: first says the number of consecutive identical numbers and then says the number itself. e. g. the sequence 1 1 3 3 3 2 2 2 2 14 14 14 11 11 11 2 will be dictated as "two one, three three, four twos, three fourteens, three elevens, one two", so you will write down the sequence 2 1 3 3 4 2 3 14 3 11 1 2. the challenge is to write the program which compresses the given sequence using this approach. input: your program should read lines from standard input. each line is a sequence of l integers, where each integer is n, separated by a whitespace. n is in range [0, 99]. l is in range [1, 400]. output: for each test case, produce a single line of output containing a compressed sequence of numbers separated by a single space char.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, ansonhunter8891
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, dubouuu
Donna and her team of five have invented a new gadget for the science exhibition in their college. which intellectual property right will protect their invention?
Answers: 1
image
Computers and Technology, 24.06.2019 00:20, talyku843
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, cheycheybabygirl01
How can the temperature of a room be raised by 5degreesf?
Answers: 1
You know the right answer?
Assume that someone dictates you a sequence of numbers and you need to write it down. for brevity, h...

Questions in other subjects:

Konu
Mathematics, 13.01.2021 20:50
Konu
Mathematics, 13.01.2021 20:50
Konu
Mathematics, 13.01.2021 20:50