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 2, 2021 06:54Yuriy LyfenkoYuriy LyfenkoScore: 149,832Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 06:54142,2881,251,544,340697,212,56902,240,512
2Jul 2, 2021 06:54144,1941,259,595,733706,550,29102,228,224
3Jul 2, 2021 06:54146,1891,281,063,801716,323,78602,228,224
4Jul 2, 2021 06:54147,1391,247,624,290720,981,00002,260,992
5Jul 2, 2021 06:54148,3181,252,326,738724,759,0001,999,0002,510,848
6Jul 2, 2021 06:54149,4481,261,032,987732,296,00002,371,584
7Jul 2, 2021 06:54149,8321,259,303,702734,175,00002,510,848
8Jul 2, 2021 06:54150,0881,264,307,023734,433,000999,0002,510,848
9Jul 2, 2021 06:54150,6891,268,331,909737,377,000999,0002,510,848
10Jul 2, 2021 06:54150,7361,266,578,479736,607,0001,998,0002,510,848
11Jul 2, 2021 06:54153,5551,277,657,907752,421,00002,367,488
12Jul 2, 2021 06:54153,6231,285,528,543750,753,0001,999,0002,510,848