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 1, 2022 23:33Bernard TeoBernard TeoScore: 58,129Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 1, 2022 23:3357,810349,625,527283,267,39302,265,088
2Nov 1, 2022 23:3357,818354,246,754283,306,86002,269,184
3Nov 1, 2022 23:3357,875348,323,800283,585,35602,260,992
4Nov 1, 2022 23:3358,089314,920,152282,641,0001,997,0002,281,472
5Nov 1, 2022 23:3358,104306,597,629282,714,0001,997,0002,281,472
6Nov 1, 2022 23:3358,128312,583,523282,829,0001,998,0002,396,160
7Nov 1, 2022 23:3358,129307,649,205282,835,0001,998,0002,400,256
8Nov 1, 2022 23:3358,143312,269,373283,904,000999,0002,396,160
9Nov 1, 2022 23:3358,146304,790,655282,914,0001,999,0002,281,472
10Nov 1, 2022 23:3358,148311,995,425282,926,0001,999,0002,281,472
11Nov 1, 2022 23:3358,167305,604,422284,018,0001,000,0002,281,472
12Nov 1, 2022 23:3358,191307,282,332284,136,0001,000,0002,281,472