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:55Yuriy LyfenkoYuriy LyfenkoScore: 140,948Success
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:55137,1871,198,773,850671,218,0001,000,0002,510,848
2Jul 2, 2021 03:55138,2561,205,845,921676,454,000999,0002,519,040
3Jul 2, 2021 03:55138,4331,202,618,665677,324,000999,0002,510,848
4Jul 2, 2021 03:55138,9821,206,530,249680,013,0001,000,0002,523,136
5Jul 2, 2021 03:55139,1481,206,755,067680,828,000999,0002,514,944
6Jul 2, 2021 03:55139,4071,209,981,250682,092,0001,000,0002,260,992
7Jul 2, 2021 03:55140,9481,216,579,480688,645,0001,998,0002,514,944
8Jul 2, 2021 03:55140,9631,217,648,475688,721,0001,999,0002,510,848
9Jul 2, 2021 03:55147,6971,256,744,127721,715,0001,999,0002,510,848
10Jul 2, 2021 03:55155,3011,333,637,480760,975,68802,228,224
11Jul 2, 2021 03:55155,4911,312,466,835761,907,55302,228,224
12Jul 2, 2021 03:55158,2241,344,971,444775,297,21902,236,416