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 listFeb 5, 2025 12:11Oleg KovalovOleg KovalovScore: 2,624,633Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 5, 2025 12:112,617,17412,866,886,61212,816,158,0007,993,0002,547,712
2Feb 5, 2025 12:112,619,93912,879,592,47912,830,705,0006,994,0002,367,488
3Feb 5, 2025 12:112,620,93312,880,471,55712,832,583,0009,991,0002,322,432
4Feb 5, 2025 12:112,624,21012,895,561,81212,846,636,00011,991,0002,387,968
5Feb 5, 2025 12:112,624,63312,896,391,53312,852,710,0007,992,0002,527,232
6Feb 5, 2025 12:112,625,46112,896,395,71812,857,765,0006,995,0002,392,064
7Feb 5, 2025 12:112,625,58312,901,721,41312,853,365,00011,991,0002,379,776
8Feb 5, 2025 12:112,626,53712,905,816,70312,860,041,0009,991,0002,494,464
9Feb 5, 2025 12:112,633,54812,940,944,60812,889,400,00014,987,0002,465,792