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 13:23Yuriy LyfenkoYuriy LyfenkoScore: 149,556Success
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 13:23149,399753,756,741729,057,0003,000,0002,334,720
2Jul 9, 2021 13:23149,406754,573,519729,091,0003,000,0002,334,720
3Jul 9, 2021 13:23149,430753,195,410729,205,0003,000,0002,334,720
4Jul 9, 2021 13:23149,488758,092,492729,494,0002,997,0002,334,720
5Jul 9, 2021 13:23149,490758,204,859726,506,0005,995,0002,543,616
6Jul 9, 2021 13:23149,547756,778,005728,781,0003,998,0002,465,792
7Jul 9, 2021 13:23149,556760,932,358728,826,0003,999,0002,473,984
8Jul 9, 2021 13:23149,576757,115,153729,921,0002,999,0002,482,176
9Jul 9, 2021 13:23149,644759,824,600731,254,0002,000,0002,334,720
10Jul 9, 2021 13:23149,751802,725,561733,778,77002,281,472
11Jul 9, 2021 13:23149,828801,854,523734,154,76202,281,472
12Jul 9, 2021 13:23149,878783,474,457734,403,26002,277,376