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 listOct 4, 2022 15:50Robert BurkeRobert BurkeScore: 55,377Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 15:5052,986317,127,351259,632,56602,187,264
2Oct 4, 2022 15:5052,990332,410,633259,652,21602,301,952
3Oct 4, 2022 15:5052,996331,759,754259,680,45702,179,072
4Oct 4, 2022 15:5055,351292,401,360270,218,0001,000,0002,281,472
5Oct 4, 2022 15:5055,369292,531,073270,305,0001,001,0002,453,504
6Oct 4, 2022 15:5055,373290,616,040270,329,0001,001,0002,441,216
7Oct 4, 2022 15:5055,377296,123,816270,346,0001,001,0002,441,216
8Oct 4, 2022 15:5055,380293,620,572270,363,0001,001,0002,281,472
9Oct 4, 2022 15:5055,413302,024,642270,522,0001,001,0002,281,472
10Oct 4, 2022 15:5055,472294,255,487269,815,0001,998,0002,457,600
11Oct 4, 2022 15:5055,572298,562,890271,302,0001,001,0002,441,216
12Oct 4, 2022 15:5055,694305,640,229271,900,000999,0002,437,120