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:15Yuriy LyfenkoYuriy LyfenkoScore: 330,549Success
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:15276,0671,407,729,1331,352,730,73602,252,800
2May 19, 2021 22:15276,0951,418,171,7761,352,863,74302,265,088
3May 19, 2021 22:15276,1451,411,866,1401,353,109,94302,252,800
4May 19, 2021 22:15330,5381,688,854,1831,619,637,30402,248,704
5May 19, 2021 22:15330,5491,676,847,1291,619,688,72902,260,992
6May 19, 2021 22:15330,5931,679,617,2421,619,907,96402,244,608
7May 19, 2021 22:15330,6041,688,492,6001,619,960,25502,256,896
8May 19, 2021 22:15330,6551,683,198,6831,620,211,94602,256,896
9May 19, 2021 22:15330,6571,690,991,7081,620,218,32902,252,800