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 listJun 6, 2021 22:00Yuriy LyfenkoYuriy LyfenkoScore: 148,787Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 6, 2021 22:00146,7501,240,670,364719,077,00002,375,680
2Jun 6, 2021 22:00147,2721,250,377,451719,634,0001,998,0002,510,848
3Jun 6, 2021 22:00147,9441,261,611,598722,927,0001,999,0002,510,848
4Jun 6, 2021 22:00148,1461,258,471,465724,916,000999,0002,510,848
5Jun 6, 2021 22:00148,3881,253,051,130726,101,0001,000,0002,510,848
6Jun 6, 2021 22:00148,4331,251,649,667725,324,0001,998,0002,510,848
7Jun 6, 2021 22:00148,7871,253,247,860729,057,00002,375,680
8Jun 6, 2021 22:00149,1571,253,687,852729,872,000999,0002,494,464
9Jun 6, 2021 22:00150,6001,261,234,098737,940,00002,506,752
10Jun 6, 2021 22:00159,0821,341,636,714779,499,59302,232,320
11Jun 6, 2021 22:00159,2411,342,921,106780,278,85002,236,416
12Jun 6, 2021 22:00164,0641,362,888,774803,912,97202,236,416