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 listDec 9, 2021 07:50Yuriy LyfenkoYuriy LyfenkoScore: 100,092Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 07:50100,022512,923,047489,109,0001,000,0002,527,232
2Dec 9, 2021 07:50100,025514,298,015489,124,0001,000,0002,527,232
3Dec 9, 2021 07:50100,078517,806,647490,381,00002,342,912
4Dec 9, 2021 07:50100,080518,341,350489,392,0001,000,0002,347,008
5Dec 9, 2021 07:50100,080516,358,237489,395,000998,0002,465,792
6Dec 9, 2021 07:50100,090519,117,961489,443,0001,000,0002,269,184
7Dec 9, 2021 07:50100,092522,572,092489,455,000998,0002,347,008
8Dec 9, 2021 07:50100,093516,407,517490,454,00002,265,088
9Dec 9, 2021 07:50100,134518,015,186488,659,0001,998,0002,265,088
10Dec 9, 2021 07:50101,050555,026,910495,145,34002,195,456
11Dec 9, 2021 07:50101,301561,519,792496,375,46902,203,648
12Dec 9, 2021 07:50101,474557,971,280497,222,80802,203,648