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 24, 2021 16:13Yuriy LyfenkoYuriy LyfenkoScore: 176,767Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 16:13172,856916,100,122846,993,17102,232,320
2May 24, 2021 15:05173,813913,982,268851,682,93902,240,512
3May 24, 2021 15:05173,899922,259,049852,107,22002,236,416
4May 24, 2021 15:48174,186913,160,479853,513,34702,232,320
5May 24, 2021 15:48175,596926,911,293860,420,08802,236,416
6May 24, 2021 16:09175,897923,852,825861,892,97502,224,128
7May 24, 2021 14:51176,555933,700,583865,119,34802,232,320
8May 24, 2021 14:51176,767942,744,110866,155,89802,228,224
9May 24, 2021 14:51177,478923,526,625869,643,76702,240,512
10May 24, 2021 15:48178,228933,847,157873,315,65302,240,512
11May 24, 2021 16:09182,265947,462,861893,096,88102,236,416
12May 24, 2021 16:13183,308955,830,210898,210,97502,240,512
13May 24, 2021 16:09183,471973,400,108899,008,21102,244,608
14May 24, 2021 15:05183,833967,823,513900,783,98502,228,224
15May 24, 2021 16:13184,583972,942,526904,458,35102,244,608