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 28, 2024 21:15Hal FHal FScore: 53,896Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:1553,692290,159,835260,091,0003,001,0002,523,136
2Apr 28, 2024 21:1553,719286,753,605261,224,0002,001,0002,289,664
3Apr 28, 2024 21:1553,724286,927,741260,244,0003,002,0002,289,664
4Apr 28, 2024 21:1553,857326,924,045263,899,79202,277,376
5Apr 28, 2024 21:1553,896330,165,611264,090,68402,265,088
6Apr 28, 2024 21:1553,896286,338,848263,092,0001,000,0002,531,328
7Apr 28, 2024 21:1553,896288,500,499261,091,0003,001,0002,289,664
8Apr 28, 2024 21:1553,970326,682,847264,452,31902,269,184
9Apr 28, 2024 21:1553,975296,121,572262,474,0002,003,0002,289,664
10Apr 28, 2024 21:1554,177296,082,828263,462,0002,003,0002,269,184
11Apr 28, 2024 21:1554,442292,027,013263,768,0002,997,0002,289,664
12Apr 28, 2024 21:1554,477293,014,718264,940,0001,999,0002,289,664