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 listAug 1, 2024 23:19Andrey LikhachevAndrey LikhachevScore: 155,264Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 1, 2024 23:19154,998785,605,177757,493,0001,998,0002,293,760
2Aug 1, 2024 23:19155,037784,806,446757,680,0001,999,0002,293,760
3Aug 1, 2024 23:19155,050791,914,315758,746,000999,0002,363,392
4Aug 1, 2024 23:19155,074786,027,686758,865,000999,0002,359,296
5Aug 1, 2024 23:19155,147784,330,302759,222,0001,000,0002,355,200
6Aug 1, 2024 23:19155,184786,874,803759,402,000999,0002,289,664
7Aug 1, 2024 23:19155,264786,686,765759,793,000999,0002,465,792
8Aug 1, 2024 23:19155,315784,624,281761,042,00002,293,760
9Aug 1, 2024 23:19155,356790,500,137761,243,00002,359,296
10Aug 1, 2024 23:19155,773830,507,967763,289,04802,203,648
11Aug 1, 2024 23:19156,010824,794,783764,450,78602,330,624
12Aug 1, 2024 23:19164,923898,844,819808,122,99602,199,552