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 3, 2021 21:34Dmitry DolgopolovDmitry DolgopolovScore: 501,539Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2021 21:34463,7892,344,124,1452,272,564,88402,260,992
2May 3, 2021 21:34463,8452,356,647,2582,272,841,34502,256,896
3May 3, 2021 21:34463,8502,331,469,4132,272,864,87902,244,608
4May 3, 2021 21:34463,8812,325,759,6812,273,017,03802,256,896
5May 3, 2021 21:34463,8892,346,812,7822,273,057,27802,248,704
6May 3, 2021 21:34463,8942,332,298,5072,273,078,92402,252,800
7May 3, 2021 21:34501,5392,514,505,6522,457,539,70102,248,704
8May 3, 2021 21:34501,5422,512,402,8102,457,555,01002,248,704
9May 3, 2021 21:34501,5512,521,906,3132,457,600,21602,256,896
10May 3, 2021 21:34501,5622,517,386,2592,457,653,98002,252,800
11May 3, 2021 21:34501,5782,511,488,9532,457,730,01802,248,704
12May 3, 2021 21:34501,6182,513,341,9432,457,926,22102,260,992