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 listJul 2, 2021 02:22Yuriy LyfenkoYuriy LyfenkoScore: 141,661Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 02:22137,690703,440,250673,680,000999,0002,527,232
2Jul 2, 2021 02:22138,475708,242,163676,528,0001,998,0002,265,088
3Jul 2, 2021 02:22139,428703,483,045682,196,0001,000,0002,371,584
4Jul 2, 2021 02:22139,880711,363,138683,414,0001,998,0002,375,680
5Jul 2, 2021 02:22140,052714,996,212685,254,0001,000,0002,527,232
6Jul 2, 2021 02:22141,127721,342,196690,525,000999,0002,265,088
7Jul 2, 2021 02:22141,661720,154,206693,141,0001,000,0002,387,968
8Jul 2, 2021 02:22141,804720,150,431692,843,0001,999,0002,375,680
9Jul 2, 2021 02:22143,320728,669,508702,266,00002,256,896
10Jul 2, 2021 02:22156,804834,085,840768,341,11102,236,416
11Jul 2, 2021 02:22156,914833,536,599768,878,18302,240,512
12Jul 2, 2021 02:22158,187837,933,871775,114,57802,244,608