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 listJul 21, 2022 19:32Robert BurkeRobert BurkeScore: 74,506Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 19:3274,443389,587,269363,771,000999,0002,281,472
2Jul 21, 2022 19:3274,457388,776,795363,841,000999,0002,281,472
3Jul 21, 2022 19:3274,461390,555,210363,860,000999,0002,281,472
4Jul 21, 2022 19:3274,478386,305,785363,942,000999,0002,281,472
5Jul 21, 2022 19:3274,480385,913,920363,951,000999,0002,277,376
6Jul 21, 2022 19:3274,500424,632,732365,049,30502,297,856
7Jul 21, 2022 19:3274,506385,534,308364,080,0001,000,0002,281,472
8Jul 21, 2022 19:3274,518394,892,482365,140,00002,281,472
9Jul 21, 2022 19:3274,519422,176,986365,144,32302,289,664
10Jul 21, 2022 19:3274,525386,458,213364,171,0001,000,0002,514,944
11Jul 21, 2022 19:3274,531433,841,989365,203,70302,297,856
12Jul 21, 2022 19:3274,572391,551,436365,404,00002,437,120