ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > IMPC - 2013-2014 > задача:


14-05-20. 50413 - Valid Permutations

IMPC - 2013-2014

Старт: 16.мар.2013 в 12:00:00
Финиш: 16.мар.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 14-03-80. 50675 - Kruja Boys
• 14-03-90. 50717 - Hurdle Jumping
• 14-04-20. 50493 - n-digit kth Prime ...
• 14-04-30. 50669 - Area of an Irregu...
• 14-04-40. 50712 - Moon algebra
• 14-04-50. 50697 - Base Stations
• 14-05-10. 50723 - Tribonacci
• 14-05-20. 50677 - The Cottage
• 14-05-20. 50413 - Valid Permut...
• 14-05-30. 50688 - Epoka Furgon
• 14-05-30. 50706 - The most crowd...
• 14-05-40. 50689 - The biggest build...
• 14-05-50. 50414 - Traffic
• 14-05-50. 50421 - Repairing road s...
• 14-05-60. 50371 - Modified Karnaug...
• 14-05-70. 50477 - Character Pyramids
• 14-05-80. 50372 - Number Quadrup...

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Arban Uka.

Valid Permutations

A number is in valid permutation form, if all of its digits appear just once. For example 12345 is in a valid permutation form while 30480 is not. In 30480 the digit 0 appears twice and it’s not a valid permutational number.

When a permutational number is multiplied with an integer, the result usually yields another permutational number. For example, if you multiply 12345 with a series of integers from 1 to 10. you get the following:
  12345 x 1 = 12345
  12345 x 2 = 24690
  12345 x 3 = 37035
  12345 x 4 = 49380
  12345 x 5 = 61725
  12345 x 6 = 74070
  12345 x 7 = 86415
  12345 x 8 = 98760
  12345 x 9 = 111105
  12345 x 10 = 123450
3 of them are not valid permutational numbers while the other 7 are valid permutational numbers.

Question: Write a program that accepts two integers (num and k). Your program will count the number of valid permutational numbers from the multiplication of the numbers from 1 to k.

Input specification
You will be given two integers (num and k) where 1 ≤ num ≤ 107 and 1 ≤ k ≤ 200.
Note: The results are in integer limit.

Output specification
Show one number: number of valid permutational numbers.

 Sample Input I   
 12345 10
 Sample Input II  
 12345 20
 Sample Output I   
 7
 Sample Output II  
 11


Для отправки решений необходимо выполнить вход.

www.contester.ru