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 9, 2021 13:27Yuriy LyfenkoYuriy LyfenkoScore: 149,511Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 13:27149,439756,177,709730,251,0002,000,0002,334,720
2Jul 9, 2021 13:27149,484760,178,720728,476,0003,997,0002,543,616
3Jul 9, 2021 13:27149,490757,530,795731,503,000999,0002,334,720
4Jul 9, 2021 13:27149,492763,960,636730,509,0002,001,0002,334,720
5Jul 9, 2021 13:27149,495766,712,355731,528,000999,0002,334,720
6Jul 9, 2021 13:27149,507761,728,712728,586,0003,997,0002,334,720
7Jul 9, 2021 13:27149,511757,378,552729,607,0002,998,0002,326,528
8Jul 9, 2021 13:27149,543757,278,871730,762,0001,999,0002,334,720
9Jul 9, 2021 13:27149,573754,843,385728,909,0003,999,0002,473,984
10Jul 9, 2021 13:27149,783795,126,580733,935,23002,297,856
11Jul 9, 2021 13:27149,865799,388,848734,339,54502,293,760
12Jul 9, 2021 13:27149,867802,477,484734,347,36702,285,568