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:42Robert BurkeRobert BurkeScore: 61,526Success
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:4259,466360,624,908291,381,35102,183,168
2Aug 1, 2022 09:4259,491350,058,892291,507,43202,174,976
3Aug 1, 2022 09:4259,542346,598,582291,757,21802,179,072
4Aug 1, 2022 09:4261,456320,246,246300,134,0001,000,0002,281,472
5Aug 1, 2022 09:4261,505327,012,558300,374,0001,001,0002,445,312
6Aug 1, 2022 09:4261,517330,471,517300,432,0001,001,0002,445,312
7Aug 1, 2022 09:4261,526325,555,235300,476,0001,001,0002,437,120
8Aug 1, 2022 09:4261,529327,077,643300,489,0001,001,0002,445,312
9Aug 1, 2022 09:4261,534324,265,544300,514,0001,001,0002,281,472
10Aug 1, 2022 09:4261,588326,430,751299,784,0001,998,0002,281,472
11Aug 1, 2022 09:4261,773329,166,495300,691,0001,997,0002,281,472
12Aug 1, 2022 09:4261,798324,868,682300,813,0001,998,0002,449,408