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 9, 2021 18:59Sergey StreminSergey StreminScore: 496,596Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2021 18:59443,2472,243,505,9132,171,908,00502,207,744
2May 9, 2021 18:59443,3582,245,781,8802,172,455,53402,211,840
3May 9, 2021 18:59443,3622,233,252,3482,172,473,72402,195,456
4May 9, 2021 18:59443,5472,233,436,6332,173,381,97002,199,552
5May 9, 2021 18:59443,8682,245,780,3902,174,954,61902,314,240
6May 9, 2021 18:59444,0852,246,617,6172,176,016,94302,191,360
7May 9, 2021 18:59496,5962,493,023,2882,433,322,58302,207,744
8May 9, 2021 18:59496,6502,498,140,3682,433,586,98902,211,840
9May 9, 2021 18:59496,9142,509,514,2162,434,877,54602,207,744
10May 9, 2021 18:59497,1932,495,977,3762,436,245,09202,211,840
11May 9, 2021 18:59497,2542,514,310,7172,436,543,25802,199,552
12May 9, 2021 18:59497,5442,506,120,9942,437,964,73302,199,552