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 16, 2021 07:15Dmitry DolgopolovDmitry DolgopolovScore: 495,390Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2021 07:15462,5472,317,648,1102,266,481,55002,252,800
2May 16, 2021 07:15462,6342,344,871,2202,266,904,16502,256,896
3May 16, 2021 07:15462,6942,328,656,0152,267,199,27602,256,896
4May 16, 2021 07:15495,3902,495,526,8292,427,413,06502,244,608
5May 16, 2021 07:15495,4662,506,338,5372,427,784,13602,248,704
6May 16, 2021 07:15495,4772,482,729,9522,427,837,87302,248,704