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 20, 2021 06:35Sergey StreminSergey StreminScore: 377,069Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 06:35303,4251,550,761,7021,486,781,36502,199,552
2May 20, 2021 06:35303,7731,549,792,0191,488,488,61502,203,648
3May 20, 2021 06:35303,8171,548,533,4891,488,704,89802,191,360
4May 20, 2021 06:35377,0691,920,071,9621,847,640,15202,195,456
5May 20, 2021 06:35377,8631,925,409,9061,851,526,88002,195,456
6May 20, 2021 06:35378,2791,914,680,7561,853,566,87502,199,552