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:25Yuriy LyfenkoYuriy LyfenkoScore: 103,787Success
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:25103,6411,038,059,832504,841,0002,999,0002,478,080
2Jul 9, 2021 12:25103,6781,028,801,760506,021,0002,000,0002,478,080
3Jul 9, 2021 12:25103,7471,038,009,353506,364,0001,997,0002,478,080
4Jul 9, 2021 12:25103,7621,034,422,927506,438,0001,997,0002,482,176
5Jul 9, 2021 12:25103,7701,033,105,477506,476,0001,997,0002,478,080
6Jul 9, 2021 12:25103,7821,035,549,962507,534,000999,0002,482,176
7Jul 9, 2021 12:25103,7871,034,746,921506,560,0001,998,0002,482,176
8Jul 9, 2021 12:25103,7971,033,409,236508,604,00002,478,080
9Jul 9, 2021 12:25103,8471,033,880,985506,853,0001,999,0002,482,176
10Jul 9, 2021 12:25120,5341,144,284,357590,615,76702,207,744
11Jul 9, 2021 12:25120,8851,164,539,872592,335,50302,195,456
12Jul 9, 2021 12:25120,9311,151,461,704592,563,00502,195,456