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 listJan 13, 2025 08:11Ian MckibbenIan MckibbenScore: 915,926Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 13, 2025 08:11915,8364,519,005,2084,485,596,0001,998,0002,277,376
2Jan 13, 2025 08:11915,8634,512,380,3404,485,733,0001,998,0002,281,472
3Jan 13, 2025 08:11915,8984,515,966,0104,485,904,0001,998,0002,273,280
4Jan 13, 2025 08:11915,9104,514,380,0944,484,963,0002,998,0002,289,664
5Jan 13, 2025 08:11915,9264,515,484,6384,485,037,0002,998,0002,281,472
6Jan 13, 2025 08:11915,9584,521,533,8384,485,198,0002,998,0002,281,472
7Jan 13, 2025 08:11915,9614,515,355,8484,486,210,0001,998,0002,269,184
8Jan 13, 2025 08:11916,0434,519,808,7674,485,614,0002,997,0002,281,472
9Jan 13, 2025 08:11916,0934,517,994,9154,486,858,0001,999,0002,277,376