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 9, 2021 12:40Yuriy LyfenkoYuriy LyfenkoScore: 123,260Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 12:40122,5281,175,404,302600,386,60802,191,360
2Jul 9, 2021 12:40122,6611,166,487,294601,036,96802,195,456
3Jul 9, 2021 12:40122,6691,159,138,701601,079,59302,211,840
4Jul 9, 2021 12:40123,2061,132,689,090601,709,0001,999,0002,465,792
5Jul 9, 2021 12:40123,2321,126,363,166603,838,00002,478,080
6Jul 9, 2021 12:40123,2561,126,325,508602,953,000999,0002,478,080
7Jul 9, 2021 12:40123,2601,125,811,049602,974,000999,0002,478,080
8Jul 9, 2021 12:40123,2681,127,134,743603,015,0001,000,0002,482,176
9Jul 9, 2021 12:40123,3021,131,238,122603,178,0001,000,0002,478,080
10Jul 9, 2021 12:40123,3071,127,936,321604,205,00002,482,176
11Jul 9, 2021 12:40123,3081,122,194,617603,210,0001,000,0002,478,080
12Jul 9, 2021 12:40123,3201,130,798,678603,268,0001,000,0002,478,080