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 listSep 30, 2022 03:55Bernard TeoBernard TeoScore: 74,249Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 30, 2022 03:5570,456407,089,181345,232,48702,265,088
2Sep 30, 2022 03:5570,463408,139,205345,269,03402,265,088
3Sep 30, 2022 03:5570,581411,499,475345,845,68902,265,088
4Sep 30, 2022 03:5574,186387,847,622362,511,0001,001,0002,281,472
5Sep 30, 2022 03:5574,219384,669,322362,672,000999,0002,404,352
6Sep 30, 2022 03:5574,244393,004,081361,799,0001,998,0002,392,064
7Sep 30, 2022 03:5574,249383,572,852361,822,0001,999,0002,396,160
8Sep 30, 2022 03:5574,268389,680,141362,914,000999,0002,281,472
9Sep 30, 2022 03:5574,268387,761,851361,915,0001,999,0002,281,472
10Sep 30, 2022 03:5574,269388,019,693361,917,0001,999,0002,281,472
11Sep 30, 2022 03:5574,290387,048,780362,023,0002,000,0002,478,080
12Sep 30, 2022 03:5574,327387,571,625364,202,00002,281,472