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: 195,322Success
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:04158,563838,449,375776,956,48002,236,416
2Jul 1, 2021 08:04158,615842,866,314777,211,34902,228,224
3Jul 1, 2021 08:04161,054846,901,243789,163,23002,228,224
4Jul 1, 2021 08:04195,029985,906,367953,641,0001,999,0002,351,104
5Jul 1, 2021 08:04195,164985,252,769954,308,0001,998,0002,523,136
6Jul 1, 2021 08:04195,302978,592,457956,980,00002,355,200
7Jul 1, 2021 08:04195,322986,761,456956,079,0001,000,0002,482,176
8Jul 1, 2021 08:04195,374986,749,806956,336,000999,0002,498,560
9Jul 1, 2021 08:04195,443987,191,909955,674,0001,999,0002,314,240
10Jul 1, 2021 08:04195,557987,009,838957,229,000999,0002,527,232
11Jul 1, 2021 08:04195,603985,516,349957,455,000999,0002,490,368
12Jul 1, 2021 08:04196,388992,347,923961,303,000999,0002,490,368