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 listJun 6, 2021 23:01Yuriy LyfenkoYuriy LyfenkoScore: 138,491Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 23:01132,4001,180,001,591646,761,0001,999,0002,506,752
2Jun 6, 2021 23:01132,4771,176,623,899649,137,00002,506,752
3Jun 6, 2021 23:01132,9531,179,423,601650,471,000999,0002,506,752
4Jun 6, 2021 23:01132,9901,179,848,014650,653,000999,0002,510,848
5Jun 6, 2021 23:01133,4401,180,186,687651,857,0001,999,0002,506,752
6Jun 6, 2021 23:01133,9731,183,002,738655,468,000999,0002,514,944
7Jun 6, 2021 23:01134,1151,183,274,188656,165,0001,000,0002,510,848
8Jun 6, 2021 23:01134,7901,189,471,561658,472,0001,998,0002,371,584
9Jun 6, 2021 23:01136,5531,195,645,696668,112,0001,000,0002,371,584
10Jun 6, 2021 23:01136,7941,202,349,895668,296,0001,997,0002,510,848
11Jun 6, 2021 23:01137,0531,200,266,032670,561,000999,0002,510,848
12Jun 6, 2021 23:01137,6601,210,073,779673,535,000999,0002,506,752
13Jun 6, 2021 23:01138,4911,203,969,760676,607,0001,998,0002,260,992
14Jun 6, 2021 23:01139,0581,212,058,847679,385,0001,998,0002,506,752
15Jun 6, 2021 23:01140,5061,214,314,115686,479,0001,998,0002,510,848
16Jun 6, 2021 23:01141,3681,220,321,007690,704,0001,999,0002,506,752
17Jun 6, 2021 23:01142,6761,230,041,756699,113,00002,379,776
18Jun 6, 2021 23:01143,9861,232,297,708703,534,0001,998,0002,506,752
19Jun 6, 2021 23:01150,1201,312,087,780735,588,71202,224,128
20Jun 6, 2021 23:01152,1981,307,151,598745,771,87702,224,128
21Jun 6, 2021 23:01153,0571,304,654,187749,979,92802,224,128
22Jun 6, 2021 23:01154,4761,322,106,032756,932,36102,228,224
23Jun 6, 2021 23:01154,6771,333,927,270757,915,57702,240,512
24Jun 6, 2021 23:01161,3121,354,983,350790,428,00202,224,128