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 listJun 14, 2021 18:00Andrey TsvetkovAndrey TsvetkovScore: 653,146Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 14, 2021 18:07652,8203,271,689,6123,198,818,79702,203,648
2Jun 14, 2021 18:07652,8993,261,840,0643,199,207,15602,211,840
3Jun 14, 2021 18:00652,9303,256,206,2723,199,357,63802,203,648
4Jun 14, 2021 17:57652,9963,273,810,7883,199,682,13802,199,552
5Jun 14, 2021 17:57653,0013,268,212,1883,199,706,89002,207,744
6Jun 14, 2021 17:57653,0463,257,834,5313,199,927,42902,187,264
7Jun 14, 2021 17:57653,1463,267,867,0073,200,416,35602,215,936
8Jun 14, 2021 17:57653,5433,261,224,2903,202,362,66102,195,456
9Jun 14, 2021 18:00653,6253,268,349,1013,202,762,30402,203,648
10Jun 14, 2021 18:07653,6523,265,788,4753,202,895,08302,203,648
11Jun 14, 2021 18:00653,7123,265,168,9893,203,190,12902,203,648
12Jun 14, 2021 17:57653,7923,264,420,3963,203,579,19802,203,648