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 listAug 1, 2022 09:37Robert BurkeRobert BurkeScore: 61,536Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 1, 2022 09:3759,451351,923,058291,308,10902,260,992
2Aug 1, 2022 09:3759,511362,828,728291,605,58102,183,168
3Aug 1, 2022 09:3761,416323,675,724298,938,0001,999,0002,453,504
4Aug 1, 2022 09:3761,510325,204,591300,400,0001,001,0002,449,408
5Aug 1, 2022 09:3761,516326,716,590300,429,0001,001,0002,445,312
6Aug 1, 2022 09:3761,523325,003,079300,461,0001,001,0002,445,312
7Aug 1, 2022 09:3761,536331,045,198299,531,0001,996,0002,269,184
8Aug 1, 2022 09:3761,556335,581,268299,627,0001,997,0002,281,472
9Aug 1, 2022 09:3761,557323,007,046300,633,000998,0002,453,504
10Aug 1, 2022 09:3761,686322,347,860301,260,0001,000,0002,535,424
11Aug 1, 2022 09:3761,791323,995,595300,779,0001,998,0002,441,216
12Aug 1, 2022 09:3762,316369,528,546305,350,22202,179,072