Problem from Yandex Weekly Offer

Правка en2, от mondayguy, 2023-12-01 22:12:11

Help, please, with a problem from the Yandex online assessment (the Yandex Weekly offer event has already ended).

Given the numbers n and m, you need to return the number of palindromes in the digital clock format like 23:23, assuming there are not 24 hours and 60 minutes in a day but n hours and m minutes. Moreover, the numbers n and m are huge and are given as strings with a length of up to 10^5.

Example for n = 12, m = 1234: 0000:0000, 0001:1000 0001:1000, 0010:0100, 0010:0100, 0011:1100. 0011:1100.

Output 4 (you should output it modulo 10^9+7)

Another example:

Input 24 60

Output 16

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский mondayguy 2023-12-01 22:12:11 2
ru3 Русский mondayguy 2023-12-01 20:55:37 3
en1 Английский mondayguy 2023-11-30 22:17:36 642 Initial revision for English translation
ru2 Русский mondayguy 2023-11-30 14:59:01 6
ru1 Русский mondayguy 2023-11-30 11:26:56 559 Первая редакция (опубликовано)