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 listJul 2, 2021 02:11Yuriy LyfenkoYuriy LyfenkoScore: 159,430Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 02:11155,3231,286,645,330761,085,00002,260,992
2Jul 2, 2021 02:11155,7391,290,088,063761,122,0001,997,0002,510,848
3Jul 2, 2021 02:11156,2081,294,512,694763,420,0001,998,0002,514,944
4Jul 2, 2021 02:11156,4391,291,287,600764,552,0001,998,0002,260,992
5Jul 2, 2021 02:11157,1081,299,597,662768,832,000999,0002,379,776
6Jul 2, 2021 02:11158,3961,302,641,498775,141,000998,0002,514,944
7Jul 2, 2021 02:11159,4301,308,267,704779,210,0001,997,0002,379,776
8Jul 2, 2021 02:11161,1041,317,690,917788,413,000999,0002,510,848
9Jul 2, 2021 02:11161,1081,317,960,126788,432,000999,0002,514,944
10Jul 2, 2021 02:11161,6411,347,054,573792,041,46702,232,320
11Jul 2, 2021 02:11162,9331,357,313,699798,373,13102,240,512
12Jul 2, 2021 02:11165,1621,363,198,663809,296,16502,248,704