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 10, 2021 02:15Yuriy LyfenkoYuriy LyfenkoScore: 96,991Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 02:1596,886547,924,796474,742,33702,199,552
2Dec 10, 2021 02:1596,952495,904,269474,065,0001,000,0002,347,008
3Dec 10, 2021 02:1596,982500,906,057474,214,0001,000,0002,265,088
4Dec 10, 2021 02:1596,986498,742,987475,232,00002,527,232
5Dec 10, 2021 02:1596,990497,766,167474,250,0001,000,0002,523,136
6Dec 10, 2021 02:1596,991545,688,382475,258,31102,199,552
7Dec 10, 2021 02:1596,991495,827,403475,258,00002,334,720
8Dec 10, 2021 02:1596,992504,498,233473,263,0001,996,0002,523,136
9Dec 10, 2021 02:1597,018504,000,161473,391,0001,997,0002,342,912
10Dec 10, 2021 02:1597,050499,647,853473,546,0001,998,0002,334,720
11Dec 10, 2021 02:1597,073507,171,112475,659,00002,338,816
12Dec 10, 2021 02:1597,095544,495,849475,763,65002,203,648