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 2, 2021 02:10Yuriy LyfenkoYuriy LyfenkoScore: 157,965Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 02:10151,9241,267,820,602743,430,000999,0002,379,776
2Jul 2, 2021 02:10155,2531,286,962,039758,741,0001,999,0002,260,992
3Jul 2, 2021 02:10155,4091,288,614,583759,505,0001,998,0002,260,992
4Jul 2, 2021 02:10155,9601,291,866,922764,204,00002,523,136
5Jul 2, 2021 02:10156,1051,289,305,847763,914,000999,0002,510,848
6Jul 2, 2021 02:10157,1981,297,496,312769,271,000999,0002,371,584
7Jul 2, 2021 02:10157,9651,338,645,080774,029,97102,232,320
8Jul 2, 2021 02:10158,5291,298,720,989776,791,00002,510,848
9Jul 2, 2021 02:10159,2311,309,575,909778,235,0001,998,0002,510,848
10Jul 2, 2021 02:10160,5161,347,010,197786,528,52302,228,224
11Jul 2, 2021 02:10161,2311,349,022,892790,032,60302,224,128
12Jul 2, 2021 02:10164,9581,338,190,862807,297,000999,0002,519,040