HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "50561 - Lucky tickets"

There is a contest!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecanSep.27.2015 at 08:58:50 PM
0-- Test 1 ---
11111110
11111112

--- Pattern ---
1

imesecanJan.03.2016 at 10:51:15 PM
1--- Test 2 ---
10000000
99999999

--- Pattern ---
4379055

imesecanJan.03.2016 at 10:55:07 PM
2When you try to calculate the sum digits of left and right parts for every number you will have time limit. Instead, you can calculate sum of digits of all numbers from 1 until 9999 and store in a lookup array.

Then when you start checking the numbers, you divide the number into two (left and right), lookup their sums from the array.


www.contester.ru