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 28, 2024 21:24Hal FHal FScore: 56,687Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:2456,541354,531,642277,052,31902,273,280
2Apr 28, 2024 21:2456,632302,934,966275,495,0002,003,0002,379,776
3Apr 28, 2024 21:2456,664303,578,860274,660,0002,996,0002,367,488
4Apr 28, 2024 21:2456,666305,334,328274,665,0002,996,0002,289,664
5Apr 28, 2024 21:2456,674303,564,738274,708,0002,996,0002,289,664
6Apr 28, 2024 21:2456,682300,923,273275,745,0001,998,0002,265,088
7Apr 28, 2024 21:2456,687300,656,445274,767,0002,997,0002,265,088
8Apr 28, 2024 21:2456,699300,244,004274,828,0002,998,0002,379,776
9Apr 28, 2024 21:2456,807306,292,138276,352,0002,002,0002,289,664
10Apr 28, 2024 21:2456,875343,442,764278,689,75102,285,568
11Apr 28, 2024 21:2457,036308,770,155278,473,0001,001,0002,289,664
12Apr 28, 2024 21:2457,834355,056,162283,385,84602,265,088