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 listOct 4, 2022 11:44Robert BurkeRobert BurkeScore: 61,623Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 11:4459,060349,558,736289,395,30102,174,976
2Oct 4, 2022 11:4459,331353,571,281290,724,26202,179,072
3Oct 4, 2022 11:4461,585324,575,346299,767,0001,998,0002,441,216
4Oct 4, 2022 11:4461,587320,658,661299,778,0001,998,0002,281,472
5Oct 4, 2022 11:4461,606326,038,646299,871,0001,999,0002,281,472
6Oct 4, 2022 11:4461,618324,859,530299,928,0001,999,0002,281,472
7Oct 4, 2022 11:4461,623325,210,452299,952,0001,999,0002,437,120
8Oct 4, 2022 11:4461,626323,986,252299,968,0001,999,0002,281,472
9Oct 4, 2022 11:4461,665321,807,681301,158,0001,000,0002,445,312
10Oct 4, 2022 11:4461,682355,755,164302,240,67802,179,072
11Oct 4, 2022 11:4462,025325,426,983301,925,0001,999,0002,281,472
12Oct 4, 2022 11:4462,076327,471,733303,174,0001,000,0002,281,472