Format integers Sergey Svistunov

Compute a checksum over the decimal representations of binary integers as fast as possible.

Input: 250 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: A uint64 checksum computed as:

CRC = sum of number_crc(n) for each n

where number_crc(n) converts n to its decimal string and sums ascii(digit) * position over each digit (0-indexed from the left).

Example: For n = 42, the decimal string is "42", so number_crc(42) = ascii('4') * 0 + ascii('2') * 1 = 52 * 0 + 50 * 1 = 50.

Back to listMay 3, 2021 10:00Yurkov AlekseyYurkov AlekseyScore: 6,292,303Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2021 10:006,154,73730,226,162,79630,158,212,52502,244,608
2May 3, 2021 10:006,165,64630,288,849,22130,211,666,86202,260,992
3May 3, 2021 10:006,170,49930,306,793,91630,235,445,81102,252,800
4May 3, 2021 10:006,280,28230,834,014,60430,773,383,68402,252,800
5May 3, 2021 10:006,292,30330,894,780,49030,832,286,98002,260,992
6May 3, 2021 10:006,294,06230,892,286,15230,840,903,90002,260,992
7May 3, 2021 10:006,294,73330,904,776,79730,844,191,94402,256,896
8May 3, 2021 10:006,296,20330,907,171,80130,851,395,21002,256,896
9May 3, 2021 10:006,307,47330,976,179,81330,906,618,62402,265,088