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 20, 2022 17:58Bernard TeoBernard TeoScore: 74,013Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 20, 2022 17:5873,966394,788,505362,435,00002,400,256
2Sep 20, 2022 17:5873,978387,570,219361,493,0001,001,0002,404,352
3Sep 20, 2022 17:5874,005387,636,294360,628,0001,997,0002,281,472
4Sep 20, 2022 17:5874,005386,648,608362,625,00002,510,848
5Sep 20, 2022 17:5874,009385,910,651360,645,0001,998,0002,281,472
6Sep 20, 2022 17:5874,012389,107,336361,659,000999,0002,281,472
7Sep 20, 2022 17:5874,013385,875,546361,665,000999,0002,396,160
8Sep 20, 2022 17:5874,025383,257,629361,723,000999,0002,281,472
9Sep 20, 2022 17:5874,047388,214,792360,833,0001,999,0002,396,160
10Sep 20, 2022 17:5875,845444,341,012371,640,16302,265,088
11Sep 20, 2022 17:5875,885436,396,336371,838,25502,269,184
12Sep 20, 2022 17:5877,694441,723,027380,699,78202,265,088