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 10, 2021 19:44Sergey StreminSergey StreminScore: 506,113Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 10, 2021 19:44429,6902,167,500,1412,105,479,52302,207,744
2May 10, 2021 19:44430,2032,168,056,2232,107,994,81602,203,648
3May 10, 2021 19:44430,3332,175,108,0652,108,629,72902,199,552
4May 10, 2021 19:44430,6332,167,672,9122,110,101,31102,207,744
5May 10, 2021 19:44430,7562,178,972,8972,110,706,06202,211,840
6May 10, 2021 19:44431,7972,188,909,1682,115,806,82802,187,264
7May 10, 2021 19:44506,1132,551,973,5902,479,955,99502,207,744
8May 10, 2021 19:44506,2772,548,754,0542,480,758,62802,203,648
9May 10, 2021 19:44506,2982,541,915,0102,480,862,35702,207,744
10May 10, 2021 19:44506,4462,557,460,8922,481,585,28202,195,456
11May 10, 2021 19:44506,5292,552,217,3842,481,991,52302,199,552
12May 10, 2021 19:44506,8002,549,334,3472,483,320,58802,187,264