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:08Yuriy LyfenkoYuriy LyfenkoScore: 101,868Success
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:08101,7591,023,679,297497,622,000999,0002,478,080
2Dec 9, 2021 07:08101,7611,027,328,877497,632,000999,0002,342,912
3Dec 9, 2021 07:08101,7821,025,578,055497,734,000999,0002,478,080
4Dec 9, 2021 07:08101,7841,025,075,525496,743,0001,998,0002,338,816
5Dec 9, 2021 07:08101,8501,018,040,643499,066,00002,478,080
6Dec 9, 2021 07:08101,8581,027,432,103497,102,0002,000,0002,478,080
7Dec 9, 2021 07:08101,8681,021,799,994499,152,00002,478,080
8Dec 9, 2021 07:08101,8981,028,433,316498,300,0001,000,0002,482,176
9Dec 9, 2021 07:08101,9111,028,345,173498,366,000998,0002,482,176
10Dec 9, 2021 07:08102,2271,055,883,127500,911,41302,207,744
11Dec 9, 2021 07:08102,2351,061,116,151500,952,44902,203,648
12Dec 9, 2021 07:08102,4001,066,917,568501,762,03402,195,456