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 2, 2021 02:14Yuriy LyfenkoYuriy LyfenkoScore: 147,113Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 02:14143,0631,225,686,761700,008,0001,000,0002,260,992
2Jul 2, 2021 02:14143,8371,231,421,687703,802,000999,0002,506,752
3Jul 2, 2021 02:14144,9001,232,683,841710,009,00002,510,848
4Jul 2, 2021 02:14145,1941,240,673,492709,452,0001,998,0002,523,136
5Jul 2, 2021 02:14145,7531,238,733,543713,193,000998,0002,514,944
6Jul 2, 2021 02:14145,8561,245,564,175713,694,000999,0002,510,848
7Jul 2, 2021 02:14147,1131,245,381,137720,852,00002,510,848
8Jul 2, 2021 02:14147,2041,250,518,391719,303,0001,998,0002,514,944
9Jul 2, 2021 02:14147,6681,250,709,202721,575,0001,998,0002,510,848
10Jul 2, 2021 02:14154,9061,322,388,011759,037,58402,236,416
11Jul 2, 2021 02:14158,0561,333,501,174774,475,22002,228,224
12Jul 2, 2021 02:14158,6691,335,563,785777,476,20902,228,224