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:41Yuriy LyfenkoYuriy LyfenkoScore: 103,781Success
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:41103,6811,031,781,878507,039,0001,000,0002,478,080
2Jul 9, 2021 12:41103,7081,031,805,728507,168,0001,000,0002,478,080
3Jul 9, 2021 12:41103,7151,031,370,052507,205,0001,000,0002,260,992
4Jul 9, 2021 12:41103,7641,039,100,748508,444,00002,478,080
5Jul 9, 2021 12:41103,7701,035,162,400506,476,0001,997,0002,260,992
6Jul 9, 2021 12:41103,7761,039,195,018506,505,0001,998,0002,478,080
7Jul 9, 2021 12:41103,7811,033,894,759506,528,0001,998,0002,347,008
8Jul 9, 2021 12:41103,8441,039,916,043506,839,0001,999,0002,478,080
9Jul 9, 2021 12:41103,8801,035,515,001508,013,0001,000,0002,478,080
10Jul 9, 2021 12:41104,2541,071,340,206510,845,95402,191,360
11Jul 9, 2021 12:41104,2871,081,954,240511,007,33102,191,360
12Jul 9, 2021 12:41104,3511,079,538,466511,321,62502,195,456