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 listJan 7, 2024 05:54matsuoka-601matsuoka-601Score: 75,279Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 7, 2024 05:5471,301404,389,385349,376,18802,273,280
2Jan 7, 2024 05:5471,314416,058,921349,439,25402,277,376
3Jan 7, 2024 05:5471,732419,040,587351,487,96602,273,280
4Jan 7, 2024 05:5475,227394,613,877365,615,0002,996,0002,285,568
5Jan 7, 2024 05:5475,243392,717,602366,693,0001,998,0002,285,568
6Jan 7, 2024 05:5475,247393,273,140366,711,0001,998,0002,285,568
7Jan 7, 2024 05:5475,279392,313,937365,869,0002,998,0002,285,568
8Jan 7, 2024 05:5475,307392,035,209366,003,0003,000,0002,277,376
9Jan 7, 2024 05:5475,766396,291,692370,253,0001,000,0002,285,568
10Jan 7, 2024 05:5477,417410,198,465378,344,0001,000,0002,269,184
11Jan 7, 2024 05:5477,480407,582,528376,653,0002,997,0002,285,568
12Jan 7, 2024 05:5479,714416,445,000389,601,000998,0002,527,232