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 23, 2022 09:30Robert BurkeRobert BurkeScore: 64,504Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 09:3061,914367,858,957303,379,44702,179,072
2Jul 23, 2022 09:3061,932373,576,000303,466,18802,187,264
3Jul 23, 2022 09:3061,965377,731,701303,630,23902,183,168
4Jul 23, 2022 09:3064,467338,821,013313,888,0001,999,0002,441,216
5Jul 23, 2022 09:3064,494338,752,405314,020,0002,000,0002,445,312
6Jul 23, 2022 09:3064,503342,619,672314,063,0002,000,0002,445,312
7Jul 23, 2022 09:3064,504338,176,921314,070,0002,000,0002,445,312
8Jul 23, 2022 09:3064,517338,430,692315,133,0001,000,0002,281,472
9Jul 23, 2022 09:3064,534346,976,223315,219,0001,000,0002,453,504
10Jul 23, 2022 09:3064,564345,359,557315,363,0001,001,0002,281,472
11Jul 23, 2022 09:3064,637339,568,160314,722,0001,998,0002,281,472
12Jul 23, 2022 09:3064,834348,151,339315,687,0001,998,0002,281,472