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 20, 2021 00:34Yurkov AlekseyYurkov AlekseyScore: 650,741Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 00:34620,6523,107,818,7403,041,193,95602,269,184
2May 20, 2021 00:34620,7073,101,385,0903,041,462,15902,273,280
3May 20, 2021 00:34621,0673,111,756,5383,043,227,36402,273,280
4May 20, 2021 00:34650,4383,260,362,8313,187,144,43802,277,376
5May 20, 2021 00:34650,7413,244,472,9233,188,628,79902,269,184
6May 20, 2021 00:34650,7633,254,205,2903,188,739,26302,273,280
7May 20, 2021 00:34650,7683,250,847,8693,188,765,63402,273,280
8May 20, 2021 00:34650,8243,260,385,6333,189,035,71002,277,376
9May 20, 2021 00:34650,8273,244,590,7913,189,054,00002,265,088