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 listMay 3, 2024 18:22Hal FHal FScore: 74,765Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2024 18:2272,131415,123,996353,441,49202,277,376
2May 3, 2024 18:2272,142435,163,672353,496,19302,273,280
3May 3, 2024 18:2272,885423,585,043357,135,29002,281,472
4May 3, 2024 18:2274,396389,073,426361,545,0002,996,0002,359,296
5May 3, 2024 18:2274,705390,149,087365,054,0001,000,0002,527,232
6May 3, 2024 18:2274,743387,763,372364,238,0002,001,0002,289,664
7May 3, 2024 18:2274,765399,081,302364,349,0002,001,0002,531,328
8May 3, 2024 18:2274,809398,290,653363,567,0002,996,0002,281,472
9May 3, 2024 18:2274,812402,053,292363,583,0002,996,0002,289,664
10May 3, 2024 18:2274,816392,395,716364,603,0001,997,0002,281,472
11May 3, 2024 18:2274,818394,946,554363,614,0002,996,0002,375,680
12May 3, 2024 18:2274,822391,583,274363,633,0002,996,0002,289,664