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 11:37Sergey StreminSergey StreminScore: 384,092Success
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 11:37288,7841,497,029,3561,415,042,15502,195,456
2May 21, 2021 11:37288,8901,483,677,2041,415,562,61902,195,456
3May 21, 2021 11:37289,0221,491,113,7341,416,208,05302,191,360
4May 21, 2021 11:37384,0921,951,566,2991,882,048,44602,191,360
5May 21, 2021 11:37384,1041,949,571,6241,882,109,02902,199,552
6May 21, 2021 11:37384,2081,953,544,4841,882,620,12702,191,360