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 10, 2021 01:40Yuriy LyfenkoYuriy LyfenkoScore: 120,447Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 01:40120,381620,903,128589,868,00002,342,912
2Dec 10, 2021 01:40120,395619,378,456587,937,0001,999,0002,527,232
3Dec 10, 2021 01:40120,426613,759,985589,086,0001,000,0002,265,088
4Dec 10, 2021 01:40120,428611,913,322589,099,0001,000,0002,347,008
5Dec 10, 2021 01:40120,437616,699,691590,140,00002,465,792
6Dec 10, 2021 01:40120,444614,678,896590,175,00002,527,232
7Dec 10, 2021 01:40120,447621,094,756590,191,00002,265,088
8Dec 10, 2021 01:40120,486620,226,379590,379,00002,437,120
9Dec 10, 2021 01:40120,525624,719,163589,574,000999,0002,523,136
10Dec 10, 2021 01:40121,012654,427,934592,958,52502,207,744
11Dec 10, 2021 01:40121,046662,235,984593,126,38902,199,552
12Dec 10, 2021 01:40121,068657,633,567593,231,14702,199,552