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 listJul 1, 2021 08:04gchebanovgchebanovScore: 189,088Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 08:04157,110822,965,065769,839,46902,228,224
2Jul 1, 2021 08:04157,112826,036,276769,850,72102,215,936
3Jul 1, 2021 08:04157,416851,828,850771,336,36202,220,032
4Jul 1, 2021 08:04157,659844,309,471772,529,06802,228,224
5Jul 1, 2021 08:04159,785852,856,933782,946,49002,232,320
6Jul 1, 2021 08:04160,083843,400,732784,404,97002,232,320
7Jul 1, 2021 08:04188,936950,003,474922,789,0002,999,0002,297,856
8Jul 1, 2021 08:04188,977947,022,077922,988,0002,999,0002,301,952
9Jul 1, 2021 08:04188,993957,481,211925,068,0001,000,0002,383,872
10Jul 1, 2021 08:04189,014954,921,370925,169,000999,0002,342,912
11Jul 1, 2021 08:04189,036951,342,832924,276,0001,998,0002,527,232
12Jul 1, 2021 08:04189,076958,904,149922,473,0003,997,0002,347,008
13Jul 1, 2021 08:04189,088956,370,163925,533,000999,0002,347,008
14Jul 1, 2021 08:04189,120955,583,729923,694,0002,995,0002,256,896
15Jul 1, 2021 08:04189,156955,215,328924,865,0001,999,0002,326,528
16Jul 1, 2021 08:04189,172952,804,949925,945,000999,0002,310,144
17Jul 1, 2021 08:04189,223952,720,776925,194,0001,998,0002,494,464
18Jul 1, 2021 08:04189,346957,474,302924,795,0002,999,0002,355,200
19Jul 1, 2021 08:04189,697954,597,108928,517,000999,0002,494,464
20Jul 1, 2021 08:04189,707966,348,483928,563,000999,0002,494,464
21Jul 1, 2021 08:04189,779957,593,192927,916,0001,999,0002,281,472
22Jul 1, 2021 08:04189,804962,517,390926,047,0003,995,0002,494,464
23Jul 1, 2021 08:04189,820962,966,430927,119,0002,997,0002,347,008
24Jul 1, 2021 08:04189,954956,534,140927,774,0002,999,0002,375,680