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:06Yuriy LyfenkoYuriy LyfenkoScore: 101,876Success
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:06101,7581,030,084,465497,613,000999,0002,347,008
2Dec 9, 2021 07:06101,7651,024,096,287496,652,0001,998,0002,342,912
3Dec 9, 2021 07:06101,8141,024,802,015496,891,0001,999,0002,473,984
4Dec 9, 2021 07:06101,8161,032,395,623497,900,000999,0002,478,080
5Dec 9, 2021 07:06101,8221,020,392,076497,929,000999,0002,482,176
6Dec 9, 2021 07:06101,8321,024,790,462498,979,00002,482,176
7Dec 9, 2021 07:06101,8761,027,869,787499,193,00002,473,984
8Dec 9, 2021 07:06101,8801,023,307,826499,210,00002,482,176
9Dec 9, 2021 07:06101,9131,030,653,698498,375,000998,0002,478,080
10Dec 9, 2021 07:06102,2291,058,028,816500,922,70102,195,456
11Dec 9, 2021 07:06102,2821,056,530,905501,182,78802,318,336
12Dec 9, 2021 07:06102,6351,066,994,310502,912,67202,207,744