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 listMay 19, 2021 21:45Andrey TsvetkovAndrey TsvetkovScore: 1,203,549Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 21:451,137,3345,627,821,2645,572,934,40502,199,552
2May 19, 2021 21:521,137,3515,625,259,1405,573,019,63502,207,744
3May 19, 2021 21:521,137,4015,627,207,9055,573,264,95602,220,032
4May 19, 2021 21:521,137,4435,645,193,0165,573,468,49702,211,840
5May 19, 2021 21:451,137,4445,645,375,8375,573,474,68702,207,744
6May 19, 2021 21:451,137,6045,626,404,6585,574,261,49602,215,936
7May 19, 2021 21:451,203,4595,964,968,4285,896,951,05402,220,032
8May 19, 2021 21:451,203,5195,969,880,7085,897,242,90302,215,936
9May 19, 2021 21:451,203,5485,955,941,0825,897,386,19102,211,840
10May 19, 2021 21:521,203,5495,953,797,5265,897,388,13602,211,840
11May 19, 2021 21:521,203,5835,975,258,8985,897,556,43502,215,936
12May 19, 2021 21:451,203,6055,961,504,2925,897,662,37502,207,744
13May 19, 2021 21:521,203,6345,960,500,6515,897,807,48702,211,840
14May 19, 2021 21:521,203,6525,947,514,6895,897,892,91502,215,936
15May 19, 2021 21:521,203,6855,970,367,9265,898,055,90502,260,992
16May 19, 2021 21:451,203,7135,958,694,1475,898,194,05102,211,840
17May 19, 2021 21:521,203,9765,963,922,7015,899,480,09302,207,744
18May 19, 2021 21:451,204,0125,977,672,4075,899,659,15302,207,744