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:27Bernard TeoBernard TeoScore: 51,274Success
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:2749,153301,908,544240,851,82302,265,088
2Nov 2, 2022 00:2749,172299,120,599240,941,64102,265,088
3Nov 2, 2022 00:2751,193274,614,298248,846,0001,998,0002,387,968
4Nov 2, 2022 00:2751,202272,428,481248,893,0001,999,0002,396,160
5Nov 2, 2022 00:2751,210280,688,764249,930,000999,0002,281,472
6Nov 2, 2022 00:2751,260276,869,502251,173,00002,396,160
7Nov 2, 2022 00:2751,274275,791,862250,242,0001,000,0002,281,472
8Nov 2, 2022 00:2751,292285,061,061251,333,00002,281,472
9Nov 2, 2022 00:2751,308287,213,513251,407,00002,281,472
10Nov 2, 2022 00:2751,348279,057,491249,608,0001,996,0002,281,472
11Nov 2, 2022 00:2751,360282,133,819250,668,000998,0002,400,256
12Nov 2, 2022 00:2752,046329,139,887255,025,13302,260,992