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:56Sergey StreminSergey StreminScore: 508,797Success
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:56436,9332,210,862,7932,140,970,18302,211,840
2May 9, 2021 18:59437,0012,204,926,2602,141,305,97002,191,360
3May 9, 2021 18:59437,0032,199,638,4802,141,316,12002,199,552
4May 9, 2021 18:59437,0192,207,995,8212,141,393,08402,203,648
5May 9, 2021 18:56437,3192,207,172,9082,142,863,32802,199,552
6May 9, 2021 18:56439,5392,227,138,7522,153,740,36602,203,648
7May 9, 2021 18:59508,7972,565,062,2892,493,104,04402,211,840
8May 9, 2021 18:56509,0352,555,943,5932,494,269,59202,195,456
9May 9, 2021 18:56509,0802,562,511,0412,494,490,35202,203,648
10May 9, 2021 18:56509,3702,554,073,6482,495,914,93202,203,648
11May 9, 2021 18:59509,4102,570,097,9912,496,109,03402,187,264
12May 9, 2021 18:59509,6672,554,869,3052,497,369,33602,199,552