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 listDec 10, 2021 01:48Yuriy LyfenkoYuriy LyfenkoScore: 111,699Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 01:48111,607573,259,830544,874,0001,999,0002,486,272
2Dec 10, 2021 01:48111,614581,483,575545,911,000999,0002,265,088
3Dec 10, 2021 01:48111,623573,138,812544,954,0001,999,0002,527,232
4Dec 10, 2021 01:48111,645575,874,411545,062,0002,000,0002,265,088
5Dec 10, 2021 01:48111,673576,482,612547,198,00002,265,088
6Dec 10, 2021 01:48111,693571,218,244546,298,0001,000,0002,527,232
7Dec 10, 2021 01:48111,699572,095,430547,323,00002,527,232
8Dec 10, 2021 01:48111,703571,995,631547,345,00002,265,088
9Dec 10, 2021 01:48111,734575,607,133546,498,000999,0002,265,088
10Dec 10, 2021 01:48112,311617,657,697550,325,03502,207,744
11Dec 10, 2021 01:48114,793624,963,062562,487,41702,203,648
12Dec 10, 2021 01:48114,837635,073,649562,700,42502,203,648