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:49Yuriy LyfenkoYuriy LyfenkoScore: 111,717Success
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:49111,656570,057,130546,112,0001,000,0002,342,912
2Dec 10, 2021 01:49111,675573,549,370546,207,0001,000,0002,342,912
3Dec 10, 2021 01:49111,678569,255,669546,220,0001,000,0002,334,720
4Dec 10, 2021 01:49111,691578,034,260547,286,00002,523,136
5Dec 10, 2021 01:49111,696572,006,064546,309,0001,000,0002,338,816
6Dec 10, 2021 01:49111,708573,709,800545,374,0001,997,0002,347,008
7Dec 10, 2021 01:49111,717576,851,409547,414,00002,265,088
8Dec 10, 2021 01:49111,740572,445,799545,530,0001,998,0002,265,088
9Dec 10, 2021 01:49111,759572,233,204545,620,0001,998,0002,265,088
10Dec 10, 2021 01:49112,276622,732,390550,154,53802,211,840
11Dec 10, 2021 01:49112,651627,376,026551,988,25002,207,744
12Dec 10, 2021 01:49114,816633,473,187562,600,83102,207,744