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 listDec 7, 2024 17:50Nick RolfeNick RolfeScore: 987,831Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 7, 2024 17:50986,5824,866,604,2844,830,254,0003,997,0002,285,568
2Dec 7, 2024 17:50987,0044,864,897,2584,833,324,0002,998,0002,285,568
3Dec 7, 2024 17:50987,4544,867,413,3924,835,525,0002,998,0002,289,664
4Dec 7, 2024 17:50987,7754,867,959,4204,838,101,0001,998,0002,273,280
5Dec 7, 2024 17:50987,8314,869,845,5274,838,374,0001,998,0002,281,472
6Dec 7, 2024 17:50988,5304,869,890,5194,842,796,000999,0002,277,376
7Dec 7, 2024 17:50988,6364,874,660,9044,842,319,0001,998,0002,281,472
8Dec 7, 2024 17:50989,3564,877,670,3884,843,848,0003,997,0002,289,664
9Dec 7, 2024 17:50989,9654,882,297,5044,848,828,0001,999,0002,281,472