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 10:20Andrey LikhachevAndrey LikhachevScore: 115,712Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 23, 2024 10:51115,256592,540,954562,754,0001,999,0002,355,200
2Aug 31, 2024 10:20115,281587,939,707562,877,0001,999,0002,367,488
3Aug 23, 2024 10:51115,322593,338,374565,076,00002,351,104
4Aug 31, 2024 10:20115,375592,589,424564,336,0001,000,0002,293,760
5Aug 23, 2024 10:51115,472590,290,923563,813,0001,999,0002,359,296
6Aug 23, 2024 10:51115,483590,669,094564,867,000999,0002,367,488
7Aug 31, 2024 10:20115,571594,800,121565,300,0001,000,0002,293,760
8Aug 23, 2024 10:51115,580596,593,260565,342,0001,000,0002,293,760
9Aug 31, 2024 10:20115,585592,416,039566,366,00002,359,296
10Aug 31, 2024 10:20115,605597,040,151564,466,0001,998,0002,359,296
11Aug 31, 2024 10:20115,635596,213,260564,612,0001,998,0002,367,488
12Aug 31, 2024 10:20115,701595,160,682565,934,000999,0002,293,760
13Aug 31, 2024 10:20115,712596,176,009565,988,000999,0002,289,664
14Aug 31, 2024 10:20115,791591,274,850566,374,0001,000,0002,363,392
15Aug 23, 2024 10:51115,989593,069,306568,345,00002,293,760
16Aug 23, 2024 10:51115,993598,215,545568,368,00002,363,392
17Aug 23, 2024 10:51116,020594,230,194566,500,0001,998,0002,363,392
18Aug 23, 2024 10:51116,039639,710,651568,590,28602,334,720
19Aug 31, 2024 10:20116,046593,695,704566,628,0001,998,0002,351,104
20Aug 31, 2024 10:20116,071600,188,681567,750,000999,0002,293,760
21Aug 23, 2024 10:51116,142639,199,332569,098,23902,203,648
22Aug 23, 2024 10:51116,198600,982,138567,369,0002,001,0002,359,296
23Aug 31, 2024 10:20116,247599,370,210567,611,0001,998,0002,293,760
24Aug 23, 2024 10:51116,544632,695,892571,066,69802,207,744