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 listJul 20, 2022 13:58Yuriy LyfenkoYuriy LyfenkoScore: 96,994Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 13:5896,922562,778,783474,919,90502,203,648
2Jul 20, 2022 13:5896,956506,130,107474,084,0001,000,0002,342,912
3Jul 20, 2022 13:5896,961500,085,524474,108,0001,000,0002,338,816
4Jul 20, 2022 13:5896,968500,201,998474,144,0001,000,0002,334,720
5Jul 20, 2022 13:5896,977500,486,809474,187,0001,000,0002,334,720
6Jul 20, 2022 13:5896,984503,983,529475,223,00002,338,816
7Jul 20, 2022 13:5896,994499,682,816475,271,00002,265,088
8Jul 20, 2022 13:5897,040501,654,824474,497,000998,0002,338,816
9Jul 20, 2022 13:5897,051532,057,834475,549,37602,203,648
10Jul 20, 2022 13:5897,054501,631,370473,566,0001,998,0002,338,816
11Jul 20, 2022 13:5897,068507,798,178474,635,000999,0002,265,088
12Jul 20, 2022 13:5897,554539,838,915478,013,20102,207,744