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 23, 2021 20:57alex3dalex3dScore: 3,873,559Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 23, 2021 20:573,748,06618,436,159,07218,365,520,99102,277,376
2May 23, 2021 20:573,753,67218,451,226,72918,392,994,01602,285,568
3May 23, 2021 20:573,757,27918,489,085,17518,410,667,83202,260,992
4May 23, 2021 20:573,873,55919,031,617,95518,980,437,55002,281,472
5May 23, 2021 20:573,876,74519,061,357,25118,996,051,96502,273,280
6May 23, 2021 20:573,879,95719,076,668,92019,011,790,72402,265,088