subject

Programming challenge description: 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 ones, three threes, 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: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
What social factors affect your health
Answers: 3
question
Computers and Technology, 24.06.2019 12:10
What is it called during the editing process when the processor ensures that a character holding a coffee mug from one angle is holding the same mug in the same way when the shot switches to another camera at another angle? cinematography continuity technology prop use
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Write an algorithm to check if a number is even or odd and show with flow chart step by step
Answers: 2
You know the right answer?
Programming challenge description: assume that someone dictates you a sequence of numbers and you n...
Questions
question
English, 28.11.2020 09:10
question
Geography, 28.11.2020 09:10
question
Mathematics, 28.11.2020 09:10
question
Mathematics, 28.11.2020 09:10
question
Arts, 28.11.2020 09:10
question
Spanish, 28.11.2020 09:10
question
History, 28.11.2020 09:10
Questions on the website: 13722363