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 12:21Robert BurkeRobert BurkeScore: 55,421Success
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 12:2153,107324,935,319260,222,87102,273,280
2Oct 4, 2022 12:2154,528341,331,380267,184,77502,269,184
3Oct 4, 2022 12:2155,391305,665,194271,414,00002,285,568
4Oct 4, 2022 12:2155,392300,691,569271,423,00002,408,448
5Oct 4, 2022 12:2155,393299,218,777270,424,0001,001,0002,400,256
6Oct 4, 2022 12:2155,395308,023,091271,434,00002,285,568
7Oct 4, 2022 12:2155,421294,134,913269,568,0001,996,0002,285,568
8Oct 4, 2022 12:2155,439299,040,398270,652,000998,0002,400,256
9Oct 4, 2022 12:2155,441300,180,323270,665,000998,0002,285,568
10Oct 4, 2022 12:2155,445301,900,069269,685,0001,997,0002,285,568
11Oct 4, 2022 12:2155,446304,907,441269,686,0001,997,0002,285,568
12Oct 4, 2022 12:2159,025347,904,828289,222,20902,269,184