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:38Yuriy LyfenkoYuriy LyfenkoScore: 103,983Success
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:38103,7841,039,058,686506,542,0001,998,0002,478,080
2Jul 9, 2021 12:38103,8551,033,566,937506,889,0001,999,0002,486,272
3Jul 9, 2021 12:38103,8851,038,968,913507,036,0002,000,0002,478,080
4Jul 9, 2021 12:38103,8951,034,987,437509,084,00002,478,080
5Jul 9, 2021 12:38103,9551,038,730,515508,382,000998,0002,523,136
6Jul 9, 2021 12:38103,9621,036,988,286507,419,0001,997,0002,342,912
7Jul 9, 2021 12:38103,9831,037,996,823508,517,000999,0002,523,136
8Jul 9, 2021 12:38103,9871,035,487,473509,537,00002,482,176
9Jul 9, 2021 12:38103,9881,034,462,678509,543,00002,486,272
10Jul 9, 2021 12:38104,4341,067,769,355511,724,38702,211,840
11Jul 9, 2021 12:38104,4471,077,181,483511,792,24702,191,360
12Jul 9, 2021 12:38104,4601,077,715,760511,852,30902,203,648