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 listJun 12, 2024 13:44matsuoka-601matsuoka-601Score: 61,374Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 12, 2024 13:4460,489318,434,154295,393,0001,001,0002,424,832
2Jun 12, 2024 13:4460,626323,216,037296,065,0001,000,0002,293,760
3Jun 12, 2024 13:4460,659321,763,170294,228,0003,002,0002,293,760
4Jun 12, 2024 13:4460,738322,493,033294,621,0002,996,0002,424,832
5Jun 12, 2024 13:4460,754329,787,489295,700,0001,997,0002,293,760
6Jun 12, 2024 13:4460,883323,942,006296,325,0002,002,0002,424,832
7Jun 12, 2024 13:4461,374369,944,889300,731,05702,281,472
8Jun 12, 2024 13:4461,376357,869,928300,744,59902,281,472
9Jun 12, 2024 13:4461,447361,803,416301,089,03502,285,568
10Jun 12, 2024 13:4462,124325,602,925302,404,0002,002,0002,424,832
11Jun 12, 2024 13:4462,260327,689,364302,072,0003,000,0002,424,832
12Jun 12, 2024 13:4464,440339,645,021312,761,0002,997,0002,416,640