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 listAug 31, 2024 21:38Yuriy LyfenkoYuriy LyfenkoScore: 112,763Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 31, 2024 21:38112,576580,494,453549,624,0001,998,0002,494,464
2Aug 31, 2024 21:38112,593577,077,880550,707,000999,0002,281,472
3Aug 31, 2024 21:38112,610578,585,261550,792,000999,0002,494,464
4Aug 31, 2024 21:38112,621578,130,268550,846,000999,0002,289,664
5Aug 31, 2024 21:38112,658580,962,370549,026,0003,000,0002,502,656
6Aug 31, 2024 21:38112,669575,291,877549,076,0003,000,0002,281,472
7Aug 31, 2024 21:38112,763582,617,373549,540,0002,997,0002,506,752
8Aug 31, 2024 21:38112,807575,703,069550,753,0001,999,0002,289,664
9Aug 31, 2024 21:38112,821577,694,995549,825,0002,999,0002,285,568
10Aug 31, 2024 21:38112,832576,316,199551,876,000999,0002,289,664
11Aug 31, 2024 21:38112,841576,766,143549,920,0002,999,0002,289,664
12Aug 31, 2024 21:38114,551591,137,729560,300,0001,000,0002,494,464