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 listMay 2, 2024 19:25Hal FHal FScore: 57,441Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 2, 2024 19:2557,216302,706,376279,359,0001,001,0002,289,664
2May 2, 2024 19:2557,243307,642,090278,488,0002,003,0002,289,664
3May 2, 2024 19:2557,287304,910,143277,708,0002,996,0002,531,328
4May 2, 2024 19:2557,289305,203,618277,720,0002,996,0002,289,664
5May 2, 2024 19:2557,304308,272,864277,791,0002,997,0002,289,664
6May 2, 2024 19:2557,420308,246,039279,355,0002,002,0002,265,088
7May 2, 2024 19:2557,441310,147,995280,462,0001,001,0002,281,472
8May 2, 2024 19:2557,768305,851,702280,064,0003,000,0002,289,664
9May 2, 2024 19:2558,759410,284,623287,917,477014,368,768
10May 2, 2024 19:2559,104406,104,917289,609,863014,098,432
11May 2, 2024 19:2559,831425,970,797293,173,133014,270,464
12May 2, 2024 19:2560,001316,364,277293,007,0001,000,0002,269,184