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 9, 2021 07:47Yuriy LyfenkoYuriy LyfenkoScore: 100,528Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:47100,471567,126,041492,308,75102,203,648
2Dec 9, 2021 07:47100,490518,062,098490,404,0001,997,0002,347,008
3Dec 9, 2021 07:47100,514519,724,736491,520,000999,0002,265,088
4Dec 9, 2021 07:47100,516519,779,527491,531,000999,0002,269,184
5Dec 9, 2021 07:47100,524522,630,488491,567,000999,0002,347,008
6Dec 9, 2021 07:47100,527518,965,779490,584,0001,998,0002,527,232
7Dec 9, 2021 07:47100,528531,048,484492,587,00002,342,912
8Dec 9, 2021 07:47100,535521,768,637490,624,0001,998,0002,338,816
9Dec 9, 2021 07:47100,536520,238,771491,626,000999,0002,334,720
10Dec 9, 2021 07:47100,537521,832,870490,632,0001,998,0002,338,816
11Dec 9, 2021 07:47100,609553,781,074492,982,05702,207,744
12Dec 9, 2021 07:47101,337564,876,280496,551,56702,203,648