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 15, 2024 05:12matsuoka-601matsuoka-601Score: 56,337Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 15, 2024 05:1252,188325,419,112255,719,30402,240,512
2Jun 15, 2024 05:1252,446320,365,808256,987,52102,260,992
3Jun 15, 2024 05:1254,075323,433,245264,967,10002,256,896
4Jun 15, 2024 05:1256,316302,803,029272,949,0002,999,0002,281,472
5Jun 15, 2024 05:1256,318300,009,166272,957,0002,999,0002,281,472
6Jun 15, 2024 05:1256,321302,713,653272,972,0002,999,0002,498,560
7Jun 15, 2024 05:1256,337296,962,272275,050,0001,000,0002,510,848
8Jun 15, 2024 05:1256,387299,325,024274,294,0002,002,0002,293,760
9Jun 15, 2024 05:1257,007307,781,503279,332,00002,289,664
10Jun 15, 2024 05:1259,426317,519,216289,188,0002,001,0002,289,664
11Jun 15, 2024 05:1259,434318,503,848288,226,0003,002,0002,502,656
12Jun 15, 2024 05:1262,735331,061,026306,402,0001,001,0002,506,752