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:32Yuriy LyfenkoYuriy LyfenkoScore: 103,836Success
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:32103,6971,030,977,201507,115,0001,000,0002,478,080
2Jul 9, 2021 12:32103,7181,036,558,376507,216,0001,000,0002,478,080
3Jul 9, 2021 12:32103,7401,038,155,999506,330,0001,997,0002,478,080
4Jul 9, 2021 12:32103,7721,034,745,758506,487,0001,997,0002,478,080
5Jul 9, 2021 12:32103,8081,034,768,871506,660,0001,998,0002,478,080
6Jul 9, 2021 12:32103,8171,037,013,014507,706,000999,0002,478,080
7Jul 9, 2021 12:32103,8361,034,619,613507,798,000999,0002,342,912
8Jul 9, 2021 12:32103,8801,037,665,940508,012,0001,000,0002,347,008
9Jul 9, 2021 12:32103,9841,036,039,398508,519,0001,001,0002,478,080
10Jul 9, 2021 12:32104,2511,066,707,047510,829,44402,195,456
11Jul 9, 2021 12:32104,2701,072,584,992510,923,91402,195,456
12Jul 9, 2021 12:32104,3811,093,636,621511,466,15102,199,552