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 listMay 24, 2021 09:01alex3dalex3dScore: 537,489Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 09:01489,9462,462,889,3132,400,737,79902,273,280
2May 24, 2021 09:01490,1212,454,964,7472,401,590,80902,273,280
3May 24, 2021 09:01490,4392,464,787,4092,403,150,38102,281,472
4May 24, 2021 09:01537,4892,688,730,5602,633,694,73502,281,472
5May 24, 2021 09:01537,7942,700,099,8922,635,192,30602,265,088
6May 24, 2021 09:01538,1302,710,957,6102,636,839,25802,269,184