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 19, 2021 22:51Mikhail ShirokovMikhail ShirokovScore: 1,473,931Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 22:511,415,01215,139,601,8166,933,559,12602,297,856
2May 19, 2021 22:511,416,33515,868,210,4606,940,042,43402,211,840
3May 19, 2021 22:511,428,79314,998,938,6987,001,086,42302,256,896
4May 19, 2021 22:511,473,66915,798,453,0327,220,978,84602,179,072
5May 19, 2021 22:511,473,93115,791,356,0227,222,259,54102,195,456
6May 19, 2021 22:511,474,60116,040,875,2697,225,546,78602,240,512
7May 19, 2021 22:511,475,53916,195,531,5187,230,143,24902,269,184
8May 19, 2021 22:511,485,56815,584,713,5977,279,283,29902,236,416
9May 19, 2021 22:511,487,61415,338,330,5017,289,306,63602,248,704