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 listSep 22, 2022 17:50Bernard TeoBernard TeoScore: 71,037Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 22, 2022 17:5069,986404,627,878342,930,64102,269,184
2Sep 22, 2022 17:5069,999408,322,128342,994,30602,269,184
3Sep 22, 2022 17:5070,993371,836,572345,867,0001,999,0002,396,160
4Sep 22, 2022 17:5071,011373,292,016345,954,0001,999,0002,281,472
5Sep 22, 2022 17:5071,020371,035,179346,999,000999,0002,404,352
6Sep 22, 2022 17:5071,024370,910,068346,018,0002,000,0002,281,472
7Sep 22, 2022 17:5071,037371,402,768346,081,0002,000,0002,281,472
8Sep 22, 2022 17:5071,048375,489,495347,136,0001,000,0002,281,472
9Sep 22, 2022 17:5071,058375,824,200348,185,00002,400,256
10Sep 22, 2022 17:5071,072373,610,121347,251,0001,000,0002,281,472
11Sep 22, 2022 17:5071,104374,172,136348,409,00002,400,256
12Sep 22, 2022 17:5073,840420,213,931361,815,88802,273,280