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 02:11Yuriy LyfenkoYuriy LyfenkoScore: 97,002Success
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 02:1196,864504,760,340473,634,000999,0002,265,088
2Dec 10, 2021 02:1196,941502,190,416474,012,0001,000,0002,265,088
3Dec 10, 2021 02:1196,958502,552,697473,094,0002,000,0002,527,232
4Dec 10, 2021 02:1196,958497,358,639473,095,0002,000,0002,265,088
5Dec 10, 2021 02:1196,974497,631,104474,172,0001,000,0002,338,816
6Dec 10, 2021 02:1196,977685,733,503475,187,13102,199,552
7Dec 10, 2021 02:1197,002505,554,414474,310,0001,000,0002,527,232
8Dec 10, 2021 02:1197,009495,453,619475,344,00002,351,104
9Dec 10, 2021 02:1197,025502,327,234474,426,000998,0002,265,088
10Dec 10, 2021 02:1197,069504,730,512473,639,0001,998,0002,338,816
11Dec 10, 2021 02:1197,615537,652,999478,311,07602,207,744
12Dec 10, 2021 02:1197,657556,355,589478,519,03502,207,744