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 20, 2022 16:54Yuriy LyfenkoYuriy LyfenkoScore: 100,028Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 16:5499,878519,220,461489,403,00002,338,816
2Jul 20, 2022 16:5499,880513,604,850488,411,0001,000,0002,265,088
3Jul 20, 2022 16:5499,976517,621,012487,884,0001,999,0002,265,088
4Jul 20, 2022 16:5499,996521,958,164487,981,0001,999,0002,265,088
5Jul 20, 2022 16:5499,997515,035,457488,984,000999,0002,265,088
6Jul 20, 2022 16:54100,001518,559,513489,004,0001,000,0002,265,088
7Jul 20, 2022 16:54100,028513,068,452489,137,0001,000,0002,338,816
8Jul 20, 2022 16:54100,033511,953,059490,163,00002,265,088
9Jul 20, 2022 16:54100,053513,747,030490,258,00002,338,816
10Jul 20, 2022 16:54100,866557,120,048494,242,49002,203,648
11Jul 20, 2022 16:54100,938564,671,048494,598,42502,207,744
12Jul 20, 2022 16:54101,480551,234,306497,251,14902,195,456