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 listOct 17, 2023 17:24Robert BurkeRobert BurkeScore: 55,553Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 17, 2023 17:2452,821324,914,384258,822,64502,179,072
2Oct 17, 2023 17:2452,890323,857,060259,160,49302,187,264
3Oct 17, 2023 17:2452,896324,527,773259,191,79902,179,072
4Oct 17, 2023 17:2455,316297,986,035269,046,0002,000,0002,281,472
5Oct 17, 2023 17:2455,328289,291,261269,109,0002,000,0002,269,184
6Oct 17, 2023 17:2455,393304,052,819270,427,0001,001,0002,281,472
7Oct 17, 2023 17:2455,553298,128,174271,210,0001,000,0002,281,472
8Oct 17, 2023 17:2455,869297,115,885271,762,0001,998,0002,445,312
9Oct 17, 2023 17:2455,934297,966,101273,077,0001,000,0002,277,376
10Oct 17, 2023 17:2455,935296,692,513272,081,0002,000,0002,281,472
11Oct 17, 2023 17:2456,050304,531,635273,648,000998,0002,445,312
12Oct 17, 2023 17:2456,303297,749,271273,888,0001,999,0002,281,472