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 24, 2022 14:40Yuriy LyfenkoYuriy LyfenkoScore: 92,541Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 24, 2022 14:4092,322478,804,607451,380,0001,000,0002,342,912
2Jul 24, 2022 14:4092,414481,646,558451,831,000999,0002,265,088
3Jul 24, 2022 14:4092,418478,517,941450,848,0001,999,0002,334,720
4Jul 24, 2022 14:4092,427478,928,803450,891,0001,999,0002,265,088
5Jul 24, 2022 14:4092,442477,101,153452,966,00002,265,088
6Jul 24, 2022 14:4092,522474,508,969453,358,00002,265,088
7Jul 24, 2022 14:4092,541480,093,046451,452,0001,997,0002,265,088
8Jul 24, 2022 14:4092,570480,599,450453,594,00002,347,008
9Jul 24, 2022 14:4092,581484,778,251451,648,0001,998,0002,527,232
10Jul 24, 2022 14:4093,886519,672,850460,043,15502,203,648
11Jul 24, 2022 14:4093,925522,402,881460,232,64102,199,552
12Jul 24, 2022 14:4094,288526,106,816462,010,23302,215,936