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 listOct 18, 2024 15:58Sybrand AarnoutseSybrand AarnoutseScore: 2,819,451Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 18, 2024 15:582,794,86013,726,140,42213,559,873,000134,939,0002,289,664
2Oct 18, 2024 15:582,801,38913,756,883,00713,598,862,000127,942,0002,281,472
3Oct 18, 2024 15:582,816,84613,837,035,98713,676,603,000125,941,0002,523,136
4Oct 18, 2024 15:582,816,88613,834,063,83113,668,810,000133,929,0002,523,136
5Oct 18, 2024 15:582,819,45113,850,223,35613,681,376,000133,935,0002,289,664
6Oct 18, 2024 15:582,824,77813,877,415,32413,688,484,000152,927,0002,281,472
7Oct 18, 2024 15:582,824,94513,875,476,46313,712,302,000129,927,0002,273,280
8Oct 18, 2024 15:582,843,64813,975,781,96413,825,939,000107,937,0002,281,472
9Oct 18, 2024 15:582,937,62014,426,635,13914,262,407,000131,929,0002,281,472