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:47Yuriy LyfenkoYuriy LyfenkoScore: 111,705Success
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:47111,627573,261,516544,975,0001,999,0002,265,088
2Dec 10, 2021 01:47111,635576,275,430545,012,0002,000,0002,265,088
3Dec 10, 2021 01:47111,674571,021,845546,203,0001,000,0002,265,088
4Dec 10, 2021 01:47111,680571,874,259546,231,0001,000,0002,265,088
5Dec 10, 2021 01:47111,682576,571,310546,241,0001,000,0002,527,232
6Dec 10, 2021 01:47111,688578,671,830547,269,00002,338,816
7Dec 10, 2021 01:47111,705573,589,737546,358,000998,0002,527,232
8Dec 10, 2021 01:47111,708576,641,515546,368,0001,000,0002,527,232
9Dec 10, 2021 01:47111,710573,080,286547,381,00002,265,088
10Dec 10, 2021 01:47112,304613,928,853550,289,94702,203,648
11Dec 10, 2021 01:47112,329604,224,018550,413,21002,207,744
12Dec 10, 2021 01:47112,370603,858,446550,612,41702,211,840