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 25, 2024 22:16Hal FHal FScore: 55,443Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 22:1654,993295,782,049267,465,0002,003,0002,285,568
2Apr 25, 2024 22:1654,994297,383,378267,468,0002,003,0002,527,232
3Apr 25, 2024 22:1655,041300,258,497266,704,0002,996,0002,285,568
4Apr 25, 2024 22:1655,138292,594,194267,175,0003,001,0002,523,136
5Apr 25, 2024 22:1655,157294,941,897267,268,0003,003,0002,285,568
6Apr 25, 2024 22:1655,173301,109,860267,355,0002,992,0002,527,232
7Apr 25, 2024 22:1655,443305,042,636268,673,0002,996,0002,527,232
8Apr 25, 2024 22:1655,522302,175,953270,059,0002,000,0002,285,568
9Apr 25, 2024 22:1655,541295,802,674269,150,0003,001,0002,285,568
10Apr 25, 2024 22:1656,353349,224,175276,131,81802,269,184
11Apr 25, 2024 22:1656,372348,353,273276,221,45802,285,568
12Apr 25, 2024 22:1693,768530,034,324459,461,04002,273,280