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 listMay 6, 2021 20:33Sergey StreminSergey StreminScore: 1,247,320Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 6, 2021 20:331,187,2075,878,439,8015,817,315,01102,199,552
2May 6, 2021 20:251,193,8655,911,818,6245,849,938,34302,199,552
3May 6, 2021 20:251,230,0946,098,775,2276,027,458,38502,191,360
4May 6, 2021 20:251,231,2646,100,731,6406,033,191,47602,207,744
5May 6, 2021 20:251,231,8776,098,040,8356,036,196,94702,207,744
6May 6, 2021 20:331,236,5106,129,236,2396,058,897,54202,203,648
7May 6, 2021 20:251,239,5446,129,334,7006,073,767,52202,207,744
8May 6, 2021 20:331,243,0036,148,574,7216,090,714,80102,199,552
9May 6, 2021 20:251,243,0246,152,440,8316,090,818,78702,203,648
10May 6, 2021 20:251,247,3206,185,331,2226,111,865,83602,203,648
11May 6, 2021 20:251,249,1566,190,532,2766,120,862,07202,195,456
12May 6, 2021 20:251,260,1736,236,086,7826,174,849,67902,203,648
13May 6, 2021 20:251,260,3836,231,259,4336,175,875,21402,191,360
14May 6, 2021 20:331,260,4846,245,577,9126,176,370,98302,199,552
15May 6, 2021 20:331,261,2076,262,048,5106,179,913,65202,195,456
16May 6, 2021 20:251,261,4696,269,694,7476,181,199,11002,199,552
17May 6, 2021 20:251,264,6846,251,262,7386,196,953,96902,199,552
18May 6, 2021 20:331,266,8256,276,941,9606,207,441,85102,203,648