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 listOct 28, 2021 17:27Yuriy LyfenkoYuriy LyfenkoScore: 102,065Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 28, 2021 17:27101,9161,028,176,815498,390,000998,0002,482,176
2Oct 28, 2021 17:27102,0041,032,903,278498,819,000999,0002,478,080
3Oct 28, 2021 17:27102,0071,025,333,889497,836,0001,999,0002,338,816
4Oct 28, 2021 17:27102,0281,024,014,357497,939,0001,999,0002,478,080
5Oct 28, 2021 17:27102,0501,027,334,199499,045,0001,000,0002,478,080
6Oct 28, 2021 17:27102,0591,028,661,972499,091,0001,000,0002,486,272
7Oct 28, 2021 17:27102,0651,025,187,822500,119,00002,478,080
8Oct 28, 2021 17:27102,0781,023,868,368499,182,0001,000,0002,482,176
9Oct 28, 2021 17:27102,1321,030,483,581499,449,000998,0002,478,080
10Oct 28, 2021 17:27103,0891,055,911,945505,135,54202,207,744
11Oct 28, 2021 17:27103,0991,062,467,128505,184,23302,191,360
12Oct 28, 2021 17:27103,1001,068,868,228505,190,28402,199,552