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 24, 2021 19:31Yuriy LyfenkoYuriy LyfenkoScore: 177,705Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 19:32173,541895,941,367850,349,02202,359,296
2May 29, 2021 14:53174,554920,586,357855,315,37302,248,704
3May 24, 2021 19:31176,263946,073,807863,688,11802,244,608
4May 24, 2021 19:32177,094941,494,950867,758,96602,232,320
5May 29, 2021 14:53177,705932,921,503870,754,20002,236,416
6May 29, 2021 14:53181,252952,767,475888,135,36402,232,320
7May 24, 2021 19:31181,984927,811,081891,722,35102,244,608
8May 24, 2021 19:31182,414939,795,440893,828,13402,232,320
9May 24, 2021 19:32190,860971,762,111935,212,90502,240,512