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 4, 2022 16:00Robert BurkeRobert BurkeScore: 54,759Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 16:0054,464336,443,603266,875,32402,179,072
2Oct 4, 2022 16:0054,470327,359,128266,903,21802,183,168
3Oct 4, 2022 16:0054,706294,255,045266,057,0002,000,0002,445,312
4Oct 4, 2022 16:0054,708289,807,290266,068,0002,000,0002,449,408
5Oct 4, 2022 16:0054,715293,539,780267,103,0001,000,0002,441,216
6Oct 4, 2022 16:0054,733295,526,798267,190,0001,000,0002,445,312
7Oct 4, 2022 16:0054,759291,399,238267,318,0001,001,0002,445,312
8Oct 4, 2022 16:0054,767296,919,148267,355,0001,001,0002,445,312
9Oct 4, 2022 16:0055,156289,177,215269,262,0001,000,0002,441,216
10Oct 4, 2022 16:0055,901301,608,993271,914,0001,999,0002,281,472
11Oct 4, 2022 16:0056,352348,077,174276,124,77502,183,168
12Oct 4, 2022 16:0056,692303,660,983275,793,0001,998,0002,445,312