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 listDec 10, 2021 01:36Yuriy LyfenkoYuriy LyfenkoScore: 111,650Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 01:36111,615568,113,123544,915,0001,999,0002,465,792
2Dec 10, 2021 01:36111,618572,052,006544,931,0001,999,0002,265,088
3Dec 10, 2021 01:36111,625575,855,405544,962,0001,999,0002,338,816
4Dec 10, 2021 01:36111,627572,600,574544,971,0001,999,0002,338,816
5Dec 10, 2021 01:36111,642574,936,931547,045,00002,338,816
6Dec 10, 2021 01:36111,649575,470,171546,081,0001,000,0002,527,232
7Dec 10, 2021 01:36111,650572,612,187547,087,00002,265,088
8Dec 10, 2021 01:36111,752572,460,113546,587,000999,0002,322,432
9Dec 10, 2021 01:36111,761574,211,645545,631,0001,998,0002,527,232
10Dec 10, 2021 01:36112,297611,267,471550,256,01802,207,744
11Dec 10, 2021 01:36112,319609,430,180550,364,36402,203,648
12Dec 10, 2021 01:36112,337604,533,691550,451,11502,211,840