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 21, 2021 15:10Sergey StreminSergey StreminScore: 181,790Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 21, 2021 15:10180,236944,242,407883,158,36802,310,144
2May 24, 2021 16:16180,311953,640,669883,523,74702,306,048
3May 21, 2021 15:09180,512950,549,078884,510,94202,314,240
4May 24, 2021 16:16180,589946,972,297884,883,83302,183,168
5May 21, 2021 15:09181,129947,257,298887,529,71902,183,168
6May 21, 2021 15:10181,165969,041,511887,707,22802,310,144
7May 21, 2021 15:10181,688977,313,625890,272,17402,183,168
8May 24, 2021 16:16181,790974,271,613890,769,94602,310,144
9May 21, 2021 15:09181,865951,536,447891,137,93702,306,048
10May 21, 2021 15:09261,8171,357,831,7981,282,902,78802,301,952
11May 21, 2021 15:10261,8311,349,398,6661,282,974,01402,187,264
12May 21, 2021 15:10262,3901,346,312,8131,285,710,69402,183,168
13May 21, 2021 15:09262,4631,361,034,0261,286,069,51602,297,856
14May 21, 2021 15:09262,5621,350,510,9901,286,554,22402,301,952
15May 21, 2021 15:10262,6151,344,005,5831,286,813,77702,187,264