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:40Hal FHal FScore: 57,146Success
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:4056,745300,743,544275,049,0003,000,0002,347,008
2Apr 27, 2024 10:4056,910300,305,878277,858,000999,0002,289,664
3Apr 27, 2024 10:4056,980344,701,784279,202,67202,277,376
4Apr 27, 2024 10:4057,009299,653,248277,344,0002,002,0002,527,232
5Apr 27, 2024 10:4057,075306,573,905276,670,0002,996,0002,289,664
6Apr 27, 2024 10:4057,105303,636,779276,815,0002,998,0002,269,184
7Apr 27, 2024 10:4057,146312,285,862279,014,0001,000,0002,519,040
8Apr 27, 2024 10:4057,154305,973,923277,057,0003,000,0002,289,664
9Apr 27, 2024 10:4057,566342,229,492282,074,03602,281,472
10Apr 27, 2024 10:4057,572316,079,846279,102,0003,001,0002,289,664
11Apr 27, 2024 10:4059,282359,382,166290,479,40902,273,280
12Apr 27, 2024 10:4062,117330,366,674302,369,0002,002,0002,342,912