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 27, 2024 12:01Hal FHal FScore: 61,712Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 12:0158,596368,180,419287,120,42402,281,472
2Apr 27, 2024 12:0159,084342,616,925289,512,08302,273,280
3Apr 27, 2024 12:0159,123355,696,758289,702,85702,281,472
4Apr 27, 2024 12:0161,556330,052,377298,629,0002,996,0002,289,664
5Apr 27, 2024 12:0161,572325,548,760299,707,0001,998,0002,523,136
6Apr 27, 2024 12:0161,641327,748,611300,042,0002,000,0002,289,664
7Apr 27, 2024 12:0161,712328,787,058301,387,0001,001,0002,265,088
8Apr 27, 2024 12:0161,737329,620,055300,513,0001,996,0002,289,664
9Apr 27, 2024 12:0162,810330,140,425305,773,0001,998,0002,273,280
10Apr 27, 2024 12:0162,873331,113,465306,079,0002,000,0002,289,664
11Apr 27, 2024 12:0162,930341,778,739306,354,0002,002,0002,269,184
12Apr 27, 2024 12:0163,532332,945,114310,305,0001,000,0002,269,184