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:43Bernard TeoBernard TeoScore: 60,270Success
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:3960,194321,617,614293,953,000999,0002,281,472
2Oct 3, 2022 04:3960,204317,897,456292,999,0001,999,0002,400,256
3Oct 3, 2022 04:4360,209321,450,427293,025,0002,000,0002,281,472
4Oct 3, 2022 04:4360,210320,739,248294,028,0001,000,0002,519,040
5Oct 3, 2022 04:3960,213318,580,902294,043,0001,000,0002,396,160
6Oct 3, 2022 04:4360,227322,909,704294,110,0001,000,0002,281,472
7Oct 3, 2022 04:3960,231315,811,612295,130,00002,400,256
8Oct 3, 2022 04:3960,254321,722,721294,246,0001,000,0002,408,448
9Oct 3, 2022 04:3960,255319,963,080294,249,0001,000,0002,404,352
10Oct 3, 2022 04:3960,259327,257,729294,271,0001,000,0002,396,160
11Oct 3, 2022 04:3960,262321,974,811294,285,0001,000,0002,281,472
12Oct 3, 2022 04:4360,266324,144,834295,304,00002,281,472
13Oct 3, 2022 04:4360,270322,920,116295,324,00002,281,472
14Oct 3, 2022 04:4360,272320,582,775294,332,0001,001,0002,396,160
15Oct 3, 2022 04:4360,276322,043,828294,356,000997,0002,281,472
16Oct 3, 2022 04:4360,296322,759,141294,450,0001,001,0002,396,160
17Oct 3, 2022 04:4360,325322,596,955294,596,000998,0002,396,160
18Oct 3, 2022 04:3960,330320,904,694294,618,000998,0002,400,256
19Oct 3, 2022 04:3960,550353,065,281296,695,23502,265,088
20Oct 3, 2022 04:4360,568363,508,015296,782,92302,260,992
21Oct 3, 2022 04:3960,580355,880,693296,844,21602,269,184
22Oct 3, 2022 04:4360,585364,811,558296,868,94002,260,992
23Oct 3, 2022 04:3960,586365,472,877296,871,40302,269,184
24Oct 3, 2022 04:4361,660357,799,670302,136,40702,273,280