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:56Hal FHal FScore: 61,220Success
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:5659,449360,628,701291,298,20502,289,664
2May 2, 2024 19:5659,478363,221,116291,443,89102,269,184
3May 2, 2024 19:5661,132325,880,115296,554,0002,995,0002,523,136
4May 2, 2024 19:5661,161320,413,707296,692,0002,996,0002,289,664
5May 2, 2024 19:5661,194325,850,656296,855,0002,998,0002,523,136
6May 2, 2024 19:5661,202325,412,775297,892,0001,999,0002,289,664
7May 2, 2024 19:5661,220322,800,130296,977,0002,999,0002,289,664
8May 2, 2024 19:5661,225329,010,767297,002,0003,000,0002,281,472
9May 2, 2024 19:5661,289327,265,195298,314,0002,002,0002,531,328
10May 2, 2024 19:5663,004369,917,669308,721,53902,277,376
11May 2, 2024 19:5666,852353,312,455325,577,0001,997,0002,289,664
12May 2, 2024 19:5666,868354,988,529324,659,0002,996,0002,269,184