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:41Dan StolyarovDan StolyarovScore: 652,555Success
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:41652,1603,222,318,7233,086,634,000108,951,0002,281,472
2Nov 16, 2024 18:41652,4023,229,940,3503,083,814,000112,956,0002,478,080
3Nov 16, 2024 18:41652,4183,227,897,4133,082,926,000113,923,0002,293,760
4Nov 16, 2024 18:41652,4313,224,735,0773,084,985,000111,926,0002,469,888
5Nov 16, 2024 18:41652,5553,223,159,6793,083,572,000113,947,0002,473,984
6Nov 16, 2024 18:41652,5893,227,762,3993,080,770,000116,915,0002,297,856
7Nov 16, 2024 18:41652,5903,230,221,1313,083,739,000113,953,0002,281,472
8Nov 16, 2024 18:41652,8633,221,812,3963,084,101,000114,929,0002,281,472
9Nov 16, 2024 18:41653,1323,234,452,0623,085,407,000114,940,0002,473,984