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 1, 2021 07:52gchebanovgchebanovScore: 211,132Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 07:53211,0911,095,957,1061,034,347,26002,314,240
2Jul 1, 2021 07:52211,1051,094,457,9181,034,413,37202,199,552
3Jul 1, 2021 07:52211,1121,098,353,9451,034,450,71802,326,528
4Jul 1, 2021 07:52211,1131,107,606,9761,034,455,78002,199,552
5Jul 1, 2021 07:52211,1191,088,955,2651,034,481,47202,199,552
6Jul 1, 2021 07:53211,1221,090,651,8031,034,497,91202,195,456
7Jul 1, 2021 07:52211,1321,099,090,4271,034,546,46102,203,648
8Jul 1, 2021 07:53211,1521,102,480,2091,034,643,36402,232,320
9Jul 1, 2021 07:52211,1531,099,666,0921,034,651,16302,236,416
10Jul 1, 2021 07:52211,1691,111,479,0581,034,726,92402,322,432
11Jul 1, 2021 07:52211,1821,113,926,2451,034,789,75102,199,552
12Jul 1, 2021 07:52211,3571,109,818,5251,035,651,06802,236,416