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:18Yuriy LyfenkoYuriy LyfenkoScore: 330,605Success
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:18276,0751,413,568,6911,352,766,83902,252,800
2May 19, 2021 22:18276,0921,410,524,8571,352,848,61602,252,800
3May 19, 2021 22:18276,1461,414,425,6451,353,114,31202,252,800
4May 19, 2021 22:18330,5921,680,312,3881,619,899,91802,244,608
5May 19, 2021 22:18330,6051,689,820,3481,619,962,93302,252,800
6May 19, 2021 22:18330,6141,678,728,9931,620,008,14202,260,992
7May 19, 2021 22:18330,6171,695,757,8791,620,024,67302,248,704
8May 19, 2021 22:18330,6561,688,529,0461,620,216,73802,252,800
9May 19, 2021 22:18330,9561,688,518,8021,621,682,70002,260,992