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 1, 2021 09:53gchebanovgchebanovScore: 194,783Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 09:53151,886822,624,106744,242,77902,260,992
2Jul 1, 2021 09:53152,307801,324,798746,303,81202,260,992
3Jul 1, 2021 09:53154,555810,844,032757,320,19702,260,992
4Jul 1, 2021 09:53194,520979,870,585952,150,000999,0002,273,280
5Jul 1, 2021 09:53194,649982,096,798952,781,000999,0002,396,160
6Jul 1, 2021 09:53194,769983,989,360952,372,0001,998,0002,404,352
7Jul 1, 2021 09:53194,783979,584,452952,438,0001,998,0002,404,352
8Jul 1, 2021 09:53194,784980,446,704952,446,0001,998,0002,523,136
9Jul 1, 2021 09:53194,791984,849,794953,478,000999,0002,531,328
10Jul 1, 2021 09:53195,218983,361,471955,568,000999,0002,523,136
11Jul 1, 2021 09:53195,299980,511,203956,966,00002,408,448
12Jul 1, 2021 09:53195,303981,960,668955,984,000999,0002,400,256