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 listMar 8, 2024 03:02Huy Duc LeHuy Duc LeScore: 165,276Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 8, 2024 03:02145,742780,282,636714,137,21402,195,456
2Mar 8, 2024 03:02146,897776,859,986719,793,90202,199,552
3Mar 8, 2024 03:02148,090791,935,626725,642,54802,199,552
4Mar 8, 2024 03:02164,017831,435,265687,728,000115,954,0002,334,720
5Mar 8, 2024 03:02164,349831,845,461693,408,000111,904,0002,281,472
6Mar 8, 2024 03:02165,067839,054,138699,986,000108,842,0002,334,720
7Mar 8, 2024 03:02165,276836,983,578700,871,000108,979,0002,330,624
8Mar 8, 2024 03:02165,425833,558,921697,640,000112,941,0002,281,472
9Mar 8, 2024 03:02165,465838,571,844699,809,000110,969,0002,277,376
10Mar 8, 2024 03:02165,854840,066,297695,730,000116,954,0002,281,472
11Mar 8, 2024 03:02166,346840,726,193705,084,000110,013,0002,342,912
12Mar 8, 2024 03:02166,493841,725,372707,839,000107,975,0002,330,624