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 9, 2021 07:22Yuriy LyfenkoYuriy LyfenkoScore: 106,699Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:22106,674550,312,026520,705,0001,998,0002,527,232
2Dec 9, 2021 07:22106,679550,651,962520,728,0001,998,0002,265,088
3Dec 9, 2021 07:22106,680552,319,746521,731,000999,0002,461,696
4Dec 9, 2021 07:22106,685556,464,781521,756,000999,0002,342,912
5Dec 9, 2021 07:22106,685556,698,052521,757,000999,0002,326,528
6Dec 9, 2021 07:22106,696548,865,878521,812,000999,0002,342,912
7Dec 9, 2021 07:22106,699547,642,561520,825,0001,999,0002,342,912
8Dec 9, 2021 07:22106,738548,961,950521,017,0002,000,0002,338,816
9Dec 9, 2021 07:22106,746555,923,666522,055,0001,000,0002,437,120
10Dec 9, 2021 07:22107,519599,259,849526,843,92202,199,552
11Dec 9, 2021 07:22107,528597,644,615526,885,52802,207,744
12Dec 9, 2021 07:22112,236599,672,800549,958,70902,203,648