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 listJun 6, 2021 22:59Yuriy LyfenkoYuriy LyfenkoScore: 139,851Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 22:59134,6241,186,622,939657,662,0001,998,0002,506,752
2Jun 6, 2021 22:59134,6441,184,717,906658,757,000999,0002,510,848
3Jun 6, 2021 22:59135,4331,192,474,094662,623,000999,0002,506,752
4Jun 6, 2021 22:59136,1651,206,575,438667,210,00002,506,752
5Jun 6, 2021 22:59136,2851,194,170,926666,797,000999,0002,506,752
6Jun 6, 2021 22:59136,8361,196,716,315668,496,0001,998,0002,506,752
7Jun 6, 2021 22:59139,8511,216,713,249684,268,0001,000,0002,514,944
8Jun 6, 2021 22:59142,8511,223,437,243698,970,000999,0002,510,848
9Jun 6, 2021 22:59147,3251,244,969,468721,892,00002,514,944
10Jun 6, 2021 22:59158,8851,344,464,164778,536,30402,232,320
11Jun 6, 2021 22:59160,2621,339,571,513785,285,67002,224,128
12Jun 6, 2021 22:59168,3841,383,500,593825,083,63002,224,128