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 24, 2024 21:20Hal FHal FScore: 76,550Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2024 21:2070,492417,975,804345,409,95002,273,280
2Apr 24, 2024 21:1870,501417,382,713345,457,19402,269,184
3Apr 24, 2024 21:2070,521406,557,358345,551,00602,273,280
4Apr 24, 2024 21:2070,524398,875,806345,569,30602,281,472
5Apr 24, 2024 21:1870,539411,867,886345,643,22102,269,184
6Apr 24, 2024 21:1870,565410,471,681345,767,85102,277,376
7Apr 24, 2024 21:2076,517403,135,166372,932,0001,999,0002,269,184
8Apr 24, 2024 21:1876,529397,762,502372,993,0001,999,0002,269,184
9Apr 24, 2024 21:1876,531397,788,718373,003,0002,000,0002,281,472
10Apr 24, 2024 21:1876,532402,905,090372,009,0003,000,0002,285,568
11Apr 24, 2024 21:2076,537398,378,455372,032,0003,000,0002,281,472
12Apr 24, 2024 21:1876,544401,096,647372,067,0003,000,0002,285,568
13Apr 24, 2024 21:1876,550396,267,199372,094,0003,000,0002,523,136
14Apr 24, 2024 21:2076,558397,464,779374,136,0001,000,0002,281,472
15Apr 24, 2024 21:2076,611404,838,542373,392,0002,002,0002,527,232
16Apr 24, 2024 21:2076,615403,158,861373,411,0002,002,0002,527,232
17Apr 24, 2024 21:2076,659400,744,628373,632,0001,998,0002,285,568
18Apr 24, 2024 21:2076,667405,082,144373,669,0001,998,0002,285,568
19Apr 24, 2024 21:1876,706399,678,356372,861,0002,998,0002,269,184
20Apr 24, 2024 21:2076,738399,429,704373,014,0003,000,0002,269,184
21Apr 24, 2024 21:1876,782402,561,183373,230,0003,001,0002,285,568
22Apr 24, 2024 21:1876,818403,677,136374,407,0002,002,0002,527,232
23Apr 24, 2024 21:1876,945402,446,238376,028,0001,002,0002,527,232
24Apr 24, 2024 21:2076,949405,212,888375,049,0002,000,0002,281,472