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 listFeb 28, 2023 11:23Robert BurkeRobert BurkeScore: 60,626Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 28, 2023 11:2357,619342,730,568282,333,91702,187,264
2Feb 28, 2023 11:2357,625335,102,832282,362,86002,179,072
3Feb 28, 2023 11:2358,109350,596,118284,732,86402,187,264
4Feb 28, 2023 11:2360,599320,417,843294,938,0001,999,0002,449,408
5Feb 28, 2023 11:2360,619320,413,345295,034,0002,000,0002,281,472
6Feb 28, 2023 11:2360,624322,545,823295,060,0002,000,0002,441,216
7Feb 28, 2023 11:2360,626319,733,796296,065,0001,000,0002,281,472
8Feb 28, 2023 11:2360,642318,451,485295,147,0002,000,0002,281,472
9Feb 28, 2023 11:2360,647323,828,235297,172,00002,441,216
10Feb 28, 2023 11:2360,649325,686,864296,180,0001,000,0002,445,312
11Feb 28, 2023 11:2360,742318,896,112295,639,0001,997,0002,527,232
12Feb 28, 2023 11:2360,750323,688,858296,677,000998,0002,445,312