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 listJul 9, 2021 12:29Yuriy LyfenkoYuriy LyfenkoScore: 103,978Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:29103,9231,037,389,885508,223,0001,000,0002,482,176
2Jul 9, 2021 12:29103,9251,038,544,547508,231,0001,000,0002,478,080
3Jul 9, 2021 12:29103,9251,037,088,752508,235,000998,0002,330,624
4Jul 9, 2021 12:29103,9431,043,949,822509,320,00002,478,080
5Jul 9, 2021 12:29103,9501,034,572,150507,357,0001,997,0002,338,816
6Jul 9, 2021 12:29103,9591,040,086,428509,400,00002,482,176
7Jul 9, 2021 12:29103,9781,038,021,348507,494,0001,998,0002,478,080
8Jul 9, 2021 12:29103,9851,036,068,203508,527,000999,0002,478,080
9Jul 9, 2021 12:29103,9901,037,111,767508,551,000999,0002,478,080
10Jul 9, 2021 12:29120,5191,146,395,775590,543,38502,199,552
11Jul 9, 2021 12:29120,5341,146,002,345590,614,72602,191,360
12Jul 9, 2021 12:29120,5961,150,186,900590,921,97102,199,552