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 9, 2021 07:04Yuriy LyfenkoYuriy LyfenkoScore: 101,964Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:04101,8651,022,166,020498,139,0001,000,0002,490,368
2Dec 9, 2021 07:04101,8751,029,108,475498,189,000998,0002,523,136
3Dec 9, 2021 07:04101,8831,030,435,212499,227,00002,478,080
4Dec 9, 2021 07:04101,9191,030,228,268498,404,0001,000,0002,482,176
5Dec 9, 2021 07:04101,9491,025,834,722499,549,00002,482,176
6Dec 9, 2021 07:04101,9621,028,300,409497,617,0001,998,0002,478,080
7Dec 9, 2021 07:04101,9641,029,055,904497,626,0001,998,0002,478,080
8Dec 9, 2021 07:04101,9771,025,599,583497,689,0001,998,0002,420,736
9Dec 9, 2021 07:04101,9791,025,547,664498,698,000999,0002,478,080
10Dec 9, 2021 07:04102,3181,059,882,398501,357,28302,195,456
11Dec 9, 2021 07:04102,4241,056,077,304501,878,59302,191,360
12Dec 9, 2021 07:04102,4651,067,080,039502,076,34902,195,456