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:35Bernard TeoBernard TeoScore: 56,604Success
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:3556,571302,307,245276,196,0001,000,0002,396,160
2Nov 1, 2022 23:3556,571299,237,876276,199,0001,000,0002,404,352
3Nov 1, 2022 23:3556,584299,468,590276,264,0001,000,0002,281,472
4Nov 1, 2022 23:3556,588302,477,607277,280,00002,281,472
5Nov 1, 2022 23:3556,596298,463,349277,319,00002,519,040
6Nov 1, 2022 23:3556,601303,046,751276,344,0001,001,0002,519,040
7Nov 1, 2022 23:3556,604303,791,180277,360,00002,281,472
8Nov 1, 2022 23:3556,620308,361,634277,440,00002,281,472
9Nov 1, 2022 23:3556,644301,694,942276,560,000998,0002,281,472
10Nov 1, 2022 23:3559,023361,290,365289,213,26202,265,088
11Nov 1, 2022 23:3559,045352,152,871289,318,25202,265,088
12Nov 1, 2022 23:3559,062349,824,528289,403,75702,273,280