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 listApr 27, 2024 10:47Hal FHal FScore: 59,357Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 10:4758,336342,145,071285,844,77702,277,376
2Apr 27, 2024 10:4758,490352,497,435286,601,00902,273,280
3Apr 27, 2024 10:4758,496356,000,006286,630,80802,277,376
4Apr 27, 2024 10:4759,186317,123,719287,012,0003,000,0002,289,664
5Apr 27, 2024 10:4759,306319,103,867287,604,0002,995,0002,289,664
6Apr 27, 2024 10:4759,314319,255,805288,644,0001,997,0002,289,664
7Apr 27, 2024 10:4759,357321,300,380287,851,0002,998,0002,269,184
8Apr 27, 2024 10:4759,389312,862,783288,007,0003,000,0002,265,088
9Apr 27, 2024 10:4759,618322,987,242290,128,0002,000,0002,273,280
10Apr 27, 2024 10:4759,675318,845,365290,407,0002,002,0002,289,664
11Apr 27, 2024 10:4759,696327,168,102289,516,0002,995,0002,281,472
12Apr 27, 2024 10:4772,123382,521,939351,402,0002,002,0002,289,664