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 00:14alex3dalex3dScore: 6,260,169Success
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 00:146,133,65530,112,974,48530,054,911,69302,265,088
2May 20, 2021 00:146,134,82130,123,136,68830,060,620,99702,248,704
3May 20, 2021 00:146,137,39830,130,034,27930,073,251,75602,265,088
4May 20, 2021 00:146,259,86730,722,938,73530,673,349,79502,252,800
5May 20, 2021 00:146,260,16930,734,104,99530,674,830,48602,256,896
6May 20, 2021 00:146,264,44930,752,503,43530,695,799,22002,256,896
7May 20, 2021 00:146,264,52330,765,956,12430,696,163,32702,248,704
8May 20, 2021 00:146,271,22330,788,657,06130,728,992,86202,256,896
9May 20, 2021 00:146,729,65733,037,086,98232,975,317,89302,248,704