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 20:03Hal FHal FScore: 58,512Success
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 20:0355,632338,260,937272,597,47402,281,472
2May 2, 2024 20:0355,658332,491,523272,724,76502,285,568
3May 2, 2024 20:0355,739326,078,042273,123,13402,281,472
4May 2, 2024 20:0358,058309,948,249283,481,0001,001,0002,265,088
5May 2, 2024 20:0358,062309,410,261282,501,0002,003,0002,269,184
6May 2, 2024 20:0358,121305,604,498281,798,0002,997,0002,523,136
7May 2, 2024 20:0358,512311,139,006283,711,0002,996,0002,531,328
8May 2, 2024 20:0358,542312,000,871283,858,0002,998,0002,289,664
9May 2, 2024 20:0359,115322,047,780286,666,0002,996,0002,523,136
10May 2, 2024 20:0361,137332,036,098299,569,00002,527,232
11May 2, 2024 20:0368,239360,642,856332,368,0002,002,0002,265,088
12May 2, 2024 20:0393,662477,445,582455,944,0002,999,0002,281,472