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 listAug 31, 2024 09:06matsuoka-601matsuoka-601Score: 66,563Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 31, 2024 09:0666,527347,842,248323,982,0001,999,0002,359,296
2Aug 31, 2024 09:0666,554347,765,561324,113,0002,000,0002,355,200
3Aug 31, 2024 09:0666,556358,445,921325,124,0001,000,0002,371,584
4Aug 31, 2024 09:0666,562356,189,939324,152,0002,000,0002,371,584
5Aug 31, 2024 09:0666,562348,289,526324,156,0002,000,0002,281,472
6Aug 31, 2024 09:0666,563352,725,712325,158,0001,000,0002,363,392
7Aug 31, 2024 09:0666,563353,561,057324,161,0002,000,0002,281,472
8Aug 31, 2024 09:0666,565347,076,563324,166,0002,001,0002,527,232
9Aug 31, 2024 09:0666,568353,641,168324,184,0002,001,0002,367,488
10Aug 31, 2024 09:0666,575352,549,969325,217,0001,000,0002,265,088
11Aug 31, 2024 09:0666,578350,044,620324,231,0002,001,0002,359,296
12Aug 31, 2024 09:0666,594350,586,860324,317,0001,995,0002,363,392