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 03:31Yuriy LyfenkoYuriy LyfenkoScore: 139,887Success
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 03:31137,1801,203,633,150672,180,00002,523,136
2Jul 2, 2021 03:31137,5681,198,873,959673,085,0001,000,0002,519,040
3Jul 2, 2021 03:31138,1031,205,649,434674,706,0001,999,0002,510,848
4Jul 2, 2021 03:31138,2361,204,129,390676,356,000999,0002,375,680
5Jul 2, 2021 03:31138,4031,203,592,082678,177,00002,523,136
6Jul 2, 2021 03:31138,6631,206,793,931677,451,0001,998,0002,514,944
7Jul 2, 2021 03:31139,8871,217,761,909683,446,0001,998,0002,371,584
8Jul 2, 2021 03:31139,9921,210,083,529684,961,000999,0002,510,848
9Jul 2, 2021 03:31140,6941,216,923,231688,401,000999,0002,510,848
10Jul 2, 2021 03:31154,5351,316,086,429757,221,15002,228,224
11Jul 2, 2021 03:31155,4281,316,352,748761,596,42502,232,320
12Jul 2, 2021 03:31156,1761,324,745,121765,262,49302,228,224