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:19Yuriy LyfenkoYuriy LyfenkoScore: 112,197Success
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:19111,8111,072,975,891545,877,0001,999,0002,478,080
2Jul 9, 2021 12:19111,8351,075,841,549546,993,000999,0002,478,080
3Jul 9, 2021 12:19111,8821,074,619,651546,223,0001,997,0002,478,080
4Jul 9, 2021 12:19111,9431,078,509,785547,522,000999,0002,482,176
5Jul 9, 2021 12:19112,0611,070,911,249548,098,0001,000,0002,338,816
6Jul 9, 2021 12:19112,1931,076,766,637547,748,0001,999,0002,478,080
7Jul 9, 2021 12:19112,1971,074,435,876547,768,0001,999,0002,478,080
8Jul 9, 2021 12:19112,2141,074,613,586547,852,0001,999,0002,478,080
9Jul 9, 2021 12:19112,3561,075,549,900549,543,000999,0002,478,080
10Jul 9, 2021 12:19123,5561,163,130,702605,422,73702,207,744
11Jul 9, 2021 12:19123,9041,173,978,129607,130,59602,207,744
12Jul 9, 2021 12:19124,1971,198,219,844608,565,77702,195,456