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 07:42Ian MckibbenIan MckibbenScore: 1,443,489Success
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 07:421,442,3307,095,093,5557,065,419,0001,998,0002,531,328
2Jan 13, 2025 07:421,442,3957,103,722,8617,064,737,0002,998,0002,387,968
3Jan 13, 2025 07:421,442,7187,095,860,2547,067,318,0001,998,0002,281,472
4Jan 13, 2025 07:421,443,2887,108,130,3587,069,112,0002,998,0002,273,280
5Jan 13, 2025 07:421,443,4897,104,167,1017,068,098,0004,997,0002,281,472
6Jan 13, 2025 07:421,443,7277,103,773,5747,072,266,0001,998,0002,273,280
7Jan 13, 2025 07:421,444,2227,104,194,5847,075,689,000999,0002,281,472
8Jan 13, 2025 07:421,448,0927,124,653,0047,092,651,0002,998,0002,273,280
9Jan 13, 2025 07:421,452,3367,143,623,2227,113,450,0002,998,0002,281,472