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 listJul 23, 2022 12:13Robert BurkeRobert BurkeScore: 64,467Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 12:1361,945365,804,118303,530,96802,179,072
2Jul 23, 2022 12:1361,970390,367,019303,651,98702,187,264
3Jul 23, 2022 12:1362,274362,248,791305,143,55802,179,072
4Jul 23, 2022 12:1364,443342,174,140313,774,0001,998,0002,445,312
5Jul 23, 2022 12:1364,453339,493,825313,822,0001,998,0002,281,472
6Jul 23, 2022 12:1364,463339,738,616313,870,0001,999,0002,535,424
7Jul 23, 2022 12:1364,467336,809,924313,888,0001,999,0002,281,472
8Jul 23, 2022 12:1364,476339,736,534313,934,0001,999,0002,281,472
9Jul 23, 2022 12:1364,483341,435,520313,970,0001,999,0002,281,472
10Jul 23, 2022 12:1364,557335,582,960315,326,0001,001,0002,273,280
11Jul 23, 2022 12:1364,667338,360,313314,867,0001,999,0002,281,472
12Jul 23, 2022 12:1365,084339,459,792316,914,0001,999,0002,277,376