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 18:24Hal FHal FScore: 53,970Success
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 18:2453,327324,716,017261,301,57602,281,472
2Apr 27, 2024 18:2453,376319,759,502261,540,69202,273,280
3Apr 27, 2024 18:2453,502291,234,365259,158,0003,001,0002,289,664
4Apr 27, 2024 18:2453,518285,478,466260,236,0002,001,0002,289,664
5Apr 27, 2024 18:2453,616288,466,897259,720,0002,996,0002,273,280
6Apr 27, 2024 18:2453,617285,445,660260,720,0002,005,0002,523,136
7Apr 27, 2024 18:2453,970328,904,171264,452,63102,273,280
8Apr 27, 2024 18:2453,982294,838,484262,509,0002,003,0002,289,664
9Apr 27, 2024 18:2454,446297,701,229263,786,0002,997,0002,269,184
10Apr 27, 2024 18:2454,471291,504,149264,909,0001,999,0002,289,664
11Apr 27, 2024 18:2454,489291,568,060264,997,0001,999,0002,289,664
12Apr 27, 2024 18:2454,512290,997,503264,107,0003,001,0002,289,664