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 12:42Yuriy LyfenkoYuriy LyfenkoScore: 103,856Success
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 12:42103,6561,029,198,837506,915,000999,0002,478,080
2Jul 9, 2021 12:42103,6961,031,662,077508,108,00002,482,176
3Jul 9, 2021 12:42103,7081,031,008,892508,171,00002,473,984
4Jul 9, 2021 12:42103,7371,039,152,178507,310,0001,000,0002,478,080
5Jul 9, 2021 12:42103,7511,035,477,989508,382,00002,478,080
6Jul 9, 2021 12:42103,7831,040,551,410508,535,00002,342,912
7Jul 9, 2021 12:42103,8561,035,575,049506,893,0001,999,0002,482,176
8Jul 9, 2021 12:42103,8741,035,204,344506,985,0001,999,0002,478,080
9Jul 9, 2021 12:42103,9341,036,469,105509,278,00002,482,176
10Jul 9, 2021 12:42104,2521,068,860,614510,834,36402,195,456
11Jul 9, 2021 12:42104,3401,074,977,864511,267,01402,322,432
12Jul 9, 2021 12:42104,3481,088,183,726511,303,17602,195,456