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 listOct 3, 2022 04:01Bernard TeoBernard TeoScore: 63,784Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 3, 2022 04:0163,718336,913,058311,219,0001,000,0002,281,472
2Oct 3, 2022 04:0163,734338,834,481312,299,00002,281,472
3Oct 3, 2022 04:0163,746338,330,218311,355,0001,001,0002,281,472
4Oct 3, 2022 04:0163,751338,580,782312,379,00002,281,472
5Oct 3, 2022 04:0163,754339,383,884311,395,0001,001,0002,396,160
6Oct 3, 2022 04:0163,779342,529,607310,523,0001,996,0002,281,472
7Oct 3, 2022 04:0163,784338,989,904311,543,000998,0002,281,472
8Oct 3, 2022 04:0163,823336,859,190311,734,000999,0002,404,352
9Oct 3, 2022 04:0163,842334,820,803310,826,0001,998,0002,404,352
10Oct 3, 2022 04:0167,286402,159,535329,700,73202,269,184
11Oct 3, 2022 04:0167,346400,733,912329,993,49402,265,088
12Oct 3, 2022 04:0168,081390,523,877333,595,75602,260,992