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 listMar 18, 2023 21:00LiamLiamScore: 713,061Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 18, 2023 21:00712,3933,552,064,4143,490,723,97202,277,376
2Mar 18, 2023 21:00712,6783,549,293,4163,492,123,43802,265,088
3Mar 18, 2023 21:00712,7593,551,971,4373,492,517,05002,273,280
4Mar 18, 2023 21:00713,0613,548,995,3023,494,000,80602,265,088
5Mar 18, 2023 21:00713,2403,572,446,2383,494,874,45402,260,992
6Mar 18, 2023 21:00713,4693,560,657,2053,495,998,31702,260,992