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:19Yuriy LyfenkoYuriy LyfenkoScore: 330,577Success
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:19276,0621,412,988,3591,352,704,95802,248,704
2May 19, 2021 22:19276,1021,423,410,6891,352,898,73102,248,704
3May 19, 2021 22:19276,1071,407,248,7601,352,922,48802,256,896
4May 19, 2021 22:19330,5671,684,955,1821,619,778,94902,256,896
5May 19, 2021 22:19330,5771,684,637,2511,619,828,94402,269,184
6May 19, 2021 22:19330,6001,690,135,6441,619,940,92202,244,608
7May 19, 2021 22:19330,6061,688,794,7681,619,969,74702,269,184
8May 19, 2021 22:19330,6151,690,072,7631,620,013,92102,252,800
9May 19, 2021 22:19330,9201,691,114,6941,621,507,25502,256,896