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,658Success
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,510759,511,863729,603,0002,998,0002,334,720
2Jul 9, 2021 13:27149,512760,486,146729,613,0002,998,0002,473,984
3Jul 9, 2021 13:27149,602758,202,316730,048,0003,000,0002,334,720
4Jul 9, 2021 13:27149,626756,217,069731,167,0002,000,0002,334,720
5Jul 9, 2021 13:27149,639757,227,276729,228,0004,001,0002,535,424
6Jul 9, 2021 13:27149,642764,329,081732,248,0001,000,0002,543,616
7Jul 9, 2021 13:27149,658761,909,646730,327,0002,997,0002,469,888
8Jul 9, 2021 13:27149,746757,873,846730,757,0002,999,0002,473,984
9Jul 9, 2021 13:27149,774758,084,309729,894,0003,999,0002,334,720
10Jul 9, 2021 13:27149,863795,842,280734,328,66902,277,376
11Jul 9, 2021 13:27149,906788,976,312734,537,67002,293,760
12Jul 9, 2021 13:27150,008801,047,578735,039,28702,285,568