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 18:15Hal FHal FScore: 56,379Success
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 18:1553,884343,706,829264,032,43502,281,472
2Apr 27, 2024 18:1553,944340,364,687264,327,89902,273,280
3Apr 27, 2024 18:1554,298325,504,975266,059,47802,277,376
4Apr 27, 2024 18:1556,109299,306,538271,937,0002,999,0002,289,664
5Apr 27, 2024 18:1556,138298,572,148273,074,0002,000,0002,289,664
6Apr 27, 2024 18:1556,182299,669,524275,291,00002,269,184
7Apr 27, 2024 18:1556,379300,583,036274,255,0002,001,0002,289,664
8Apr 27, 2024 18:1556,396298,663,094274,339,0002,002,0002,269,184
9Apr 27, 2024 18:1556,455306,152,510273,633,0002,995,0002,289,664
10Apr 27, 2024 18:1556,461307,970,474274,660,0001,997,0002,363,392
11Apr 27, 2024 18:1556,786304,958,517276,250,0002,001,0002,527,232
12Apr 27, 2024 18:1556,885301,542,647275,738,0002,997,0002,269,184