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:58Yuriy LyfenkoYuriy LyfenkoScore: 111,698Success
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:58111,631571,917,944545,991,000999,0002,265,088
2Dec 10, 2021 01:58111,655568,086,997547,109,00002,265,088
3Dec 10, 2021 01:58111,671571,924,430546,190,0001,000,0002,265,088
4Dec 10, 2021 01:58111,676574,843,239546,213,0001,000,0002,527,232
5Dec 10, 2021 01:58111,679577,962,547545,232,0001,997,0002,265,088
6Dec 10, 2021 01:58111,689576,588,493547,277,00002,342,912
7Dec 10, 2021 01:58111,698575,553,449546,318,0001,000,0002,527,232
8Dec 10, 2021 01:58111,699578,649,537545,328,0001,997,0002,342,912
9Dec 10, 2021 01:58111,740577,750,265546,528,000999,0002,265,088
10Dec 10, 2021 01:58112,209616,647,339549,826,19702,203,648
11Dec 10, 2021 01:58112,218617,285,717549,867,32302,203,648
12Dec 10, 2021 01:58112,248624,498,767550,015,53902,207,744