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 listApr 27, 2024 13:26Hal FHal FScore: 59,540Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 13:2656,457331,406,070276,640,67902,269,184
2Apr 27, 2024 13:2656,480339,358,230276,750,09302,265,088
3Apr 27, 2024 13:2656,481351,323,481276,756,84302,273,280
4Apr 27, 2024 13:2659,482314,328,841290,461,0001,001,0002,523,136
5Apr 27, 2024 13:2659,492322,095,708289,506,0002,003,0002,527,232
6Apr 27, 2024 13:2659,517318,304,929288,638,0002,996,0002,289,664
7Apr 27, 2024 13:2659,540321,008,345288,749,0002,997,0002,273,280
8Apr 27, 2024 13:2659,555315,504,375288,820,0002,998,0002,289,664
9Apr 27, 2024 13:2659,594321,487,805291,010,0001,000,0002,289,664
10Apr 27, 2024 13:2659,691325,798,080290,484,0002,003,0002,523,136
11Apr 27, 2024 13:2659,696322,758,232290,507,0002,003,0002,273,280
12Apr 27, 2024 13:2659,803316,853,612291,035,0002,000,0002,523,136