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 6, 2021 20:24Sergey StreminSergey StreminScore: 1,942,945Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 6, 2021 20:241,866,0349,226,802,4899,143,567,08002,199,552
2May 6, 2021 20:241,866,3529,206,159,1969,145,125,35802,195,456
3May 6, 2021 20:241,866,3699,218,481,9679,145,206,41102,191,360
4May 6, 2021 20:241,866,6919,209,226,6559,146,786,67002,191,360
5May 6, 2021 20:241,866,7319,208,811,1369,146,982,21502,191,360
6May 6, 2021 20:241,866,7369,217,367,3739,147,005,32102,195,456
7May 6, 2021 20:241,942,9459,590,305,0809,520,431,79502,195,456
8May 6, 2021 20:241,950,0139,633,997,1929,555,064,95302,195,456
9May 6, 2021 20:241,950,3739,621,348,2339,556,829,23102,191,360
10May 6, 2021 20:241,950,8279,642,308,6729,559,054,06502,187,264
11May 6, 2021 20:241,950,8689,619,134,2929,559,254,23402,195,456
12May 6, 2021 20:241,950,8699,633,075,6559,559,260,39702,183,168