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 listMay 3, 2021 22:06Stanislav-PovolotskyStanislav-PovolotskyScore: 6,357,229Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2021 22:066,242,05530,657,558,54130,586,067,08302,260,992
2May 3, 2021 22:066,245,33130,659,969,49030,602,120,71602,256,896
3May 3, 2021 22:066,251,15730,689,163,31530,630,668,33302,256,896
4May 3, 2021 22:066,357,22931,217,047,89531,150,421,29302,248,704
5May 3, 2021 22:066,358,83331,217,890,28931,158,283,74202,248,704
6May 3, 2021 22:066,360,15931,226,488,76331,164,779,43502,252,800