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 7, 2021 07:42Sergey StreminSergey StreminScore: 1,070,580Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 7, 2021 07:421,015,3375,044,308,5194,975,149,09502,199,552
2May 7, 2021 07:421,015,6915,036,004,0644,976,884,92902,203,648
3May 7, 2021 07:421,016,3305,055,058,9194,980,015,22602,191,360
4May 7, 2021 07:421,018,4555,057,528,0354,990,429,55902,199,552
5May 7, 2021 07:421,023,2025,076,147,9425,013,690,95802,256,896
6May 7, 2021 07:421,025,7855,083,751,1815,026,345,60702,203,648
7May 7, 2021 07:421,070,5805,310,374,4215,245,842,52502,260,992
8May 7, 2021 07:421,071,7925,318,607,2025,251,782,24102,207,744
9May 7, 2021 07:421,073,1335,312,366,2405,258,351,07402,207,744
10May 7, 2021 07:421,073,3395,325,845,7375,259,362,62502,203,648
11May 7, 2021 07:421,076,6185,359,106,9365,275,429,69102,273,280
12May 7, 2021 07:421,083,2205,370,419,4865,307,779,75602,207,744