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 listMay 19, 2021 22:33Yuriy LyfenkoYuriy LyfenkoScore: 380,482Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 22:24291,3211,488,460,4841,427,472,21502,179,072
2May 19, 2021 22:24291,3241,487,462,2371,427,487,99002,306,048
3May 19, 2021 22:33291,3531,488,988,8121,427,628,35902,187,264
4May 19, 2021 22:33291,3581,492,494,8891,427,655,24802,183,168
5May 19, 2021 22:24291,3711,486,696,9111,427,718,09502,183,168
6May 19, 2021 22:33291,4041,498,471,2981,427,880,50602,183,168
7May 19, 2021 22:33379,9331,916,321,2551,861,670,03902,183,168
8May 19, 2021 22:24380,0951,930,147,3311,862,463,58602,191,360
9May 19, 2021 22:33380,1811,933,702,0251,862,885,53802,195,456
10May 19, 2021 22:24380,4821,933,873,4471,864,362,45402,183,168
11May 19, 2021 22:33380,5291,927,796,6071,864,593,12102,183,168
12May 19, 2021 22:24380,7081,918,686,7771,865,468,38002,174,976
13May 19, 2021 22:24380,8151,930,377,4641,865,991,25502,183,168
14May 19, 2021 22:33381,0171,943,917,6051,866,981,98802,179,072
15May 19, 2021 22:24381,0181,937,312,0381,866,985,85802,179,072
16May 19, 2021 22:33381,0401,935,915,1171,867,098,11602,306,048
17May 19, 2021 22:33381,1361,945,085,1651,867,568,59202,191,360
18May 19, 2021 22:24381,1621,933,520,1311,867,695,44002,174,976