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 listApr 28, 2024 21:11Hal FHal FScore: 54,285Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:1152,706317,918,604258,259,05302,281,472
2Apr 28, 2024 21:1152,973332,790,658259,566,42402,277,376
3Apr 28, 2024 21:1153,155334,253,662260,458,28202,285,568
4Apr 28, 2024 21:1154,247292,307,795263,812,0001,998,0002,265,088
5Apr 28, 2024 21:1154,256291,064,463263,856,0001,998,0002,269,184
6Apr 28, 2024 21:1154,263288,590,455263,889,0001,999,0002,289,664
7Apr 28, 2024 21:1154,285288,820,023263,998,0001,999,0002,527,232
8Apr 28, 2024 21:1154,290292,520,781264,019,0002,000,0002,289,664
9Apr 28, 2024 21:1154,519294,902,843265,143,0002,001,0002,273,280
10Apr 28, 2024 21:1154,541300,855,598265,249,0002,001,0002,277,376
11Apr 28, 2024 21:1160,808320,334,381294,962,0002,999,0002,289,664
12Apr 28, 2024 21:1191,034473,965,872443,067,0003,000,0002,523,136