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 24, 2021 08:43alex3dalex3dScore: 503,175Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 08:43498,2972,514,013,3372,441,657,64402,269,184
2May 24, 2021 08:40498,3942,506,922,3122,442,130,10002,285,568
3May 24, 2021 08:40498,3952,509,084,9352,442,135,62902,281,472
4May 24, 2021 08:43498,4022,493,395,0322,442,168,74902,269,184
5May 24, 2021 08:43498,5392,507,691,2962,442,843,28602,273,280
6May 24, 2021 08:43502,9152,528,591,8602,464,283,98702,265,088
7May 24, 2021 08:40503,1752,529,427,0812,465,559,43502,277,376
8May 24, 2021 08:43503,1792,530,496,2372,465,577,80802,269,184
9May 24, 2021 08:40503,1952,526,261,8932,465,655,32102,281,472
10May 24, 2021 08:43503,2182,526,853,3512,465,768,66602,277,376
11May 24, 2021 08:40504,0552,548,058,1072,469,870,17202,269,184
12May 24, 2021 08:40508,7782,562,538,9972,493,012,24402,265,088