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 listJun 17, 2021 20:08Yuriy LyfenkoYuriy LyfenkoScore: 139,451Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 17, 2021 20:08133,8681,178,495,654653,956,0001,999,0002,510,848
2Jun 17, 2021 20:08134,6511,190,660,086657,793,0001,999,0002,510,848
3Jun 17, 2021 20:08136,6141,198,490,169667,411,0001,998,0002,510,848
4Jun 17, 2021 20:08137,0081,199,952,372671,338,00002,506,752
5Jun 17, 2021 20:08137,2661,201,395,544670,605,0001,998,0002,510,848
6Jun 17, 2021 20:08137,8171,203,758,539675,302,00002,379,776
7Jun 17, 2021 20:08139,4511,211,779,780682,312,000998,0002,510,848
8Jun 17, 2021 20:08139,7751,209,514,547683,900,000999,0002,494,464
9Jun 17, 2021 20:08141,4241,219,088,608691,980,000999,0002,523,136
10Jun 17, 2021 20:08157,8651,341,346,448773,537,51202,228,224
11Jun 17, 2021 20:08160,5751,347,547,347786,819,49602,244,608
12Jun 17, 2021 20:08163,6301,354,753,894801,786,32202,240,512