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:05Huy Duc LeHuy Duc LeScore: 164,818Success
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:05145,302778,911,644711,979,56602,265,088
2Mar 8, 2024 03:05146,040774,446,866715,596,89402,265,088
3Mar 8, 2024 03:05148,232795,806,217726,335,22402,265,088
4Mar 8, 2024 03:05163,793824,668,240637,670,000164,914,0002,269,184
5Mar 8, 2024 03:05164,033826,269,102632,812,000170,949,0002,281,472
6Mar 8, 2024 03:05164,339832,759,298691,225,000114,037,0002,289,664
7Mar 8, 2024 03:05164,818835,103,014688,665,000118,942,0002,269,184
8Mar 8, 2024 03:05165,903837,026,701697,937,000114,989,0002,281,472
9Mar 8, 2024 03:05166,149844,504,918696,113,000118,019,0002,281,472
10Mar 8, 2024 03:05166,684838,852,777707,784,000108,966,0002,281,472
11Mar 8, 2024 03:05167,239847,494,694715,538,000103,933,0002,281,472
12Mar 8, 2024 03:05167,521846,640,944695,875,000124,977,0002,281,472