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 listJul 20, 2022 13:59Yuriy LyfenkoYuriy LyfenkoScore: 106,797Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 13:59105,296601,249,963515,951,76602,228,224
2Jul 20, 2022 13:59105,450578,899,702516,704,18802,224,128
3Jul 20, 2022 13:59106,719545,934,311520,922,0001,999,0002,490,368
4Jul 20, 2022 13:59106,780547,382,733522,222,0001,000,0002,494,464
5Jul 20, 2022 13:59106,784546,865,622522,242,0001,000,0002,289,664
6Jul 20, 2022 13:59106,787546,320,276523,254,00002,498,560
7Jul 20, 2022 13:59106,797550,073,372523,307,00002,289,664
8Jul 20, 2022 13:59106,812550,343,592522,381,0001,000,0002,486,272
9Jul 20, 2022 13:59106,813547,293,706521,383,0002,001,0002,289,664
10Jul 20, 2022 13:59106,908549,744,346521,849,0001,999,0002,486,272
11Jul 20, 2022 13:59106,916546,211,769521,887,0001,999,0002,289,664
12Jul 20, 2022 13:59108,343604,311,360530,881,64202,228,224