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 listAug 21, 2021 17:53Yuriy LyfenkoYuriy LyfenkoScore: 111,809Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 21, 2021 17:53106,4621,082,193,681521,662,98202,207,744
2Aug 21, 2021 17:53106,5791,084,261,988522,235,04002,203,648
3Aug 21, 2021 17:53106,8861,105,708,551523,739,13402,203,648
4Aug 21, 2021 17:53111,6511,068,438,475546,089,0001,000,0002,281,472
5Aug 21, 2021 17:53111,7261,078,288,014546,458,0001,000,0002,498,560
6Aug 21, 2021 17:53111,7311,073,277,100545,483,0002,001,0002,281,472
7Aug 21, 2021 17:53111,8091,071,150,699545,860,0002,003,0002,494,464
8Aug 21, 2021 17:53111,8511,077,500,913547,071,0001,001,0002,502,656
9Aug 21, 2021 17:53111,8531,077,124,706547,078,0001,000,0002,498,560
10Aug 21, 2021 17:53111,8581,073,191,812547,103,0001,002,0002,498,560
11Aug 21, 2021 17:53111,8811,079,126,636547,214,0001,002,0002,502,656
12Aug 21, 2021 17:53111,9301,079,228,068545,461,0002,997,0002,281,472