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 listNov 16, 2024 18:46Dan StolyarovDan StolyarovScore: 652,368Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 16, 2024 18:46652,0923,224,527,2603,080,315,000114,937,0002,469,888
2Nov 16, 2024 18:46652,2183,225,767,7373,081,943,000113,923,0002,281,472
3Nov 16, 2024 18:46652,2413,219,698,2083,084,051,000111,929,0002,285,568
4Nov 16, 2024 18:46652,3243,225,410,4683,083,445,000112,943,0002,465,792
5Nov 16, 2024 18:46652,3683,227,103,1903,081,691,000114,913,0002,285,568
6Nov 16, 2024 18:46652,4963,223,874,2863,080,296,000116,935,0002,281,472
7Nov 16, 2024 18:46652,4983,225,165,1813,082,305,000114,936,0002,469,888
8Nov 16, 2024 18:46652,5443,226,156,0833,080,524,000116,943,0002,465,792
9Nov 16, 2024 18:46652,5733,224,679,8493,078,661,000118,948,0002,293,760