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 21, 2021 11:58Sergey StreminSergey StreminScore: 256,176Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 21, 2021 11:59189,757996,993,375929,809,81502,281,472
2May 21, 2021 11:58189,7581,015,942,779929,812,27902,269,184
3May 21, 2021 11:59189,788996,983,482929,962,25402,281,472
4May 21, 2021 11:58189,794996,280,095929,989,20202,285,568
5May 21, 2021 11:58189,8841,012,783,798930,429,38802,277,376
6May 21, 2021 11:59190,1391,002,439,840931,679,92802,265,088
7May 21, 2021 11:59256,1761,327,789,6681,255,263,53202,273,280
8May 21, 2021 11:58256,1901,321,074,6381,255,331,50502,285,568
9May 21, 2021 11:58256,2341,319,589,7451,255,547,85802,285,568
10May 21, 2021 11:59256,2521,330,801,0451,255,635,62002,281,472
11May 21, 2021 11:58256,2581,321,785,8061,255,663,16502,273,280
12May 21, 2021 11:59256,3221,328,054,1421,255,976,27902,281,472