12377 - Number Coding

All about problems in Volume 123. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
magurmach
New poster
Posts: 26
Joined: Mon May 14, 2012 8:19 pm

12377 - Number Coding

Post by magurmach » Tue Jun 26, 2012 7:39 am

Some random input-output:

Input:

Code: Select all

7
1987654
31203
31230
313140
3123450
5135798
51357980
Output:

Code: Select all

9
0
504
1008
1512
15120
30240

magurmach
New poster
Posts: 26
Joined: Mon May 14, 2012 8:19 pm

Re: 12377 - Number Coding

Post by magurmach » Tue Jun 26, 2012 7:46 am

One little Spoiler:

43560=2^3×3^2×5^1×11^2 has 4 factors with frequencies 3, 2, 1 and 2, hence coded as 41223. So, if you are backtracking you have to keep in mind that you want a sequence of number such that it is in non-descending order! More clearly, for test case 31223 a valid sequence of powers may be 1 2 23 not 1 22 3

Post Reply

Return to “Volume 123 (12300-12399)”