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 listDec 20, 2023 11:48matsuoka-601matsuoka-601Score: 184,339Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 20, 2023 11:56182,553949,831,341894,507,28902,301,952
2Dec 20, 2023 11:56183,462966,255,846898,961,90802,306,048
3Dec 20, 2023 11:48183,667966,714,654899,968,40602,285,568
4Dec 20, 2023 11:56184,339963,259,366903,262,21702,289,664
5Dec 20, 2023 11:48184,473994,503,173903,917,96502,289,664
6Dec 20, 2023 11:48184,865965,656,339905,840,37802,297,856