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 listNov 2, 2022 00:30Bernard TeoBernard TeoScore: 48,156Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 2, 2022 00:3048,081265,975,270235,597,00002,404,352
2Nov 2, 2022 00:3048,084264,454,559234,614,000998,0002,404,352
3Nov 2, 2022 00:3048,112257,590,668233,753,0001,997,0002,396,160
4Nov 2, 2022 00:3048,114260,962,832234,762,000998,0002,281,472
5Nov 2, 2022 00:3048,134263,490,775233,860,0001,998,0002,396,160
6Nov 2, 2022 00:3048,136260,052,105234,867,000999,0002,281,472
7Nov 2, 2022 00:3048,156265,351,465234,963,000999,0002,281,472
8Nov 2, 2022 00:3048,160260,682,040234,987,000999,0002,400,256
9Nov 2, 2022 00:3048,231257,549,187236,330,00002,400,256
10Nov 2, 2022 00:3048,636292,241,009238,317,21602,265,088
11Nov 2, 2022 00:3048,691316,560,550238,588,29402,265,088
12Nov 2, 2022 00:3051,028309,276,699250,037,09902,260,992