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:28Sergey StreminSergey StreminScore: 489,831Success
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:28419,0432,111,523,8102,053,312,66302,199,552
2May 10, 2021 19:28420,0832,134,313,5462,058,406,86602,203,648
3May 10, 2021 19:28420,2712,122,619,0032,059,327,11202,207,744
4May 10, 2021 19:28489,8312,463,537,0022,400,169,54302,199,552
5May 10, 2021 19:28490,8542,470,479,4912,405,186,50302,195,456
6May 10, 2021 19:28491,5542,460,620,4832,408,615,69202,203,648