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 listOct 4, 2022 15:03Robert BurkeRobert BurkeScore: 61,401Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 15:0360,627317,107,908295,073,0002,000,0002,273,280
2Oct 4, 2022 15:0360,750319,649,636295,676,0001,997,0002,281,472
3Oct 4, 2022 15:0360,754320,837,500295,698,0001,997,0002,441,216
4Oct 4, 2022 15:0360,779320,049,186295,820,0001,998,0002,281,472
5Oct 4, 2022 15:0360,849325,056,668296,160,0002,001,0002,281,472
6Oct 4, 2022 15:0361,373328,701,972298,731,0001,998,0002,437,120
7Oct 4, 2022 15:0361,401330,109,076298,866,0001,999,0002,441,216
8Oct 4, 2022 15:0363,383383,493,735310,576,47102,179,072
9Oct 4, 2022 15:0363,459329,104,513308,951,0001,999,0002,445,312
10Oct 4, 2022 15:0363,988382,504,453313,541,37902,179,072
11Oct 4, 2022 15:0364,768345,246,913316,360,0001,001,0002,281,472
12Oct 4, 2022 15:0369,307410,799,215339,606,62202,187,264