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 19:26Hal FHal FScore: 53,813Success
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 19:2653,275321,645,809261,046,40502,277,376
2Apr 28, 2024 19:2653,698286,592,579260,120,0003,001,0002,273,280
3Apr 28, 2024 19:2653,733290,404,185262,291,0001,001,0002,269,184
4Apr 28, 2024 19:2653,734289,710,856261,297,0002,002,0002,523,136
5Apr 28, 2024 19:2653,763328,695,853263,436,38202,273,280
6Apr 28, 2024 19:2653,763294,027,926262,440,0001,001,0002,527,232
7Apr 28, 2024 19:2653,813325,218,655263,684,75102,281,472
8Apr 28, 2024 19:2653,869290,870,688260,957,0002,999,0002,273,280
9Apr 28, 2024 19:2654,116292,562,245262,169,0003,001,0002,289,664
10Apr 28, 2024 19:2654,129288,097,452263,230,0002,001,0002,289,664
11Apr 28, 2024 19:2654,134292,272,788263,256,0002,001,0002,273,280
12Apr 28, 2024 19:2654,141294,573,895262,299,0002,992,0002,289,664