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:00gchebanovgchebanovScore: 189,625Success
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:01155,815827,913,811763,495,44602,224,128
2Jul 1, 2021 08:01155,832819,519,418763,575,53602,224,128
3Jul 1, 2021 08:00156,386839,813,950766,293,06502,228,224
4Jul 1, 2021 08:00156,768835,866,046768,163,14102,228,224
5Jul 1, 2021 08:00158,228845,373,665775,318,60202,224,128
6Jul 1, 2021 08:01158,681835,177,903777,535,94502,228,224
7Jul 1, 2021 08:00189,364947,759,516926,884,000999,0002,498,560
8Jul 1, 2021 08:01189,390955,209,754928,012,00002,482,176
9Jul 1, 2021 08:01189,411956,729,264928,114,00002,338,816
10Jul 1, 2021 08:00189,530961,906,618926,696,0001,999,0002,494,464
11Jul 1, 2021 08:01189,537957,077,088926,733,0001,999,0002,498,560
12Jul 1, 2021 08:01189,539954,976,729927,743,000999,0002,494,464
13Jul 1, 2021 08:00189,625961,451,839929,161,00002,387,968
14Jul 1, 2021 08:01189,627954,929,863929,170,00002,342,912
15Jul 1, 2021 08:00189,676956,659,611926,414,0002,998,0002,387,968
16Jul 1, 2021 08:00189,691958,783,276928,485,000999,0002,498,560
17Jul 1, 2021 08:00189,739953,824,073928,721,000999,0002,342,912
18Jul 1, 2021 08:01189,789956,334,005927,967,0001,999,0002,383,872
19Jul 1, 2021 08:01190,002964,720,271928,012,0003,000,0002,404,352
20Jul 1, 2021 08:00190,015956,000,188929,075,0001,998,0002,490,368
21Jul 1, 2021 08:00190,043960,089,939931,211,00002,347,008
22Jul 1, 2021 08:00190,160961,444,630930,786,000999,0002,338,816
23Jul 1, 2021 08:01190,225954,819,091931,101,0001,000,0002,527,232
24Jul 1, 2021 08:01190,327964,052,785931,602,000999,0002,359,296