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:29Yuriy LyfenkoYuriy LyfenkoScore: 103,963Success
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:29103,8041,037,459,725506,643,0001,998,0002,260,992
2Jul 9, 2021 12:29103,8361,041,997,802506,797,0001,999,0002,478,080
3Jul 9, 2021 12:29103,8491,033,895,811507,859,000999,0002,478,080
4Jul 9, 2021 12:29103,8821,032,095,693509,022,00002,478,080
5Jul 9, 2021 12:29103,8981,028,351,395508,099,0001,000,0002,482,176
6Jul 9, 2021 12:29103,9261,039,570,492507,239,0001,997,0002,334,720
7Jul 9, 2021 12:29103,9631,039,516,264508,423,000998,0002,523,136
8Jul 9, 2021 12:29103,9691,034,458,792508,448,000998,0002,260,992
9Jul 9, 2021 12:29103,9841,039,689,385508,525,000999,0002,473,984
10Jul 9, 2021 12:29120,5721,147,904,874590,802,80002,191,360
11Jul 9, 2021 12:29120,5911,151,870,771590,897,72902,195,456
12Jul 9, 2021 12:29120,9571,159,943,652592,690,67602,203,648