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 4, 2022 10:11Robert BurkeRobert BurkeScore: 61,515Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 10:1159,433363,064,390291,223,92802,187,264
2Oct 4, 2022 10:1159,447356,263,654291,288,65202,179,072
3Oct 4, 2022 10:1159,463360,938,833291,366,96202,297,856
4Oct 4, 2022 10:1459,498346,879,724291,539,54902,187,264
5Oct 4, 2022 10:1459,500350,887,513291,550,87602,187,264
6Oct 4, 2022 10:1459,720350,192,124292,629,79002,179,072
7Oct 4, 2022 10:1161,464324,370,191300,172,0001,000,0002,445,312
8Oct 4, 2022 10:1461,490322,137,870300,300,0001,001,0002,281,472
9Oct 4, 2022 10:1161,500327,756,968300,348,0001,001,0002,281,472
10Oct 4, 2022 10:1461,501332,304,435300,353,0001,001,0002,445,312
11Oct 4, 2022 10:1461,503324,390,330300,362,0001,001,0002,449,408
12Oct 4, 2022 10:1461,508327,633,260300,389,0001,001,0002,281,472
13Oct 4, 2022 10:1161,515333,913,510300,424,0001,001,0002,441,216
14Oct 4, 2022 10:1161,515334,364,874300,423,0001,001,0002,281,472
15Oct 4, 2022 10:1461,529323,016,889299,496,0001,996,0002,281,472
16Oct 4, 2022 10:1461,532329,524,263299,513,0001,996,0002,281,472
17Oct 4, 2022 10:1461,540329,478,633299,549,0001,996,0002,441,216
18Oct 4, 2022 10:1161,552327,740,033300,605,000998,0002,269,184
19Oct 4, 2022 10:1161,557331,213,644300,629,000998,0002,441,216
20Oct 4, 2022 10:1161,593326,574,442299,806,0001,998,0002,281,472
21Oct 4, 2022 10:1461,603329,578,273299,856,0001,999,0002,449,408
22Oct 4, 2022 10:1461,669326,117,444301,180,0001,000,0002,281,472
23Oct 4, 2022 10:1161,932328,903,929302,468,0001,001,0002,445,312
24Oct 4, 2022 10:1161,986326,913,061301,735,0001,998,0002,269,184