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 21, 2021 08:19Sergey StreminSergey StreminScore: 270,933Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 21, 2021 08:20206,4991,074,506,0861,011,847,46002,207,744
2May 21, 2021 08:20206,5571,075,488,1331,012,131,65002,195,456
3May 21, 2021 08:19206,6121,083,708,6301,012,398,02002,314,240
4May 21, 2021 08:19206,7201,077,343,8671,012,928,56702,191,360
5May 21, 2021 08:19206,7301,079,929,3851,012,975,72702,191,360
6May 21, 2021 08:20206,9281,092,802,6681,013,948,04302,203,648
7May 21, 2021 08:20270,9331,396,957,5711,327,570,44802,203,648
8May 21, 2021 08:19271,1881,387,569,6131,328,821,13102,199,552
9May 21, 2021 08:19271,2791,394,512,0111,329,264,65202,187,264
10May 21, 2021 08:20271,3871,388,458,1561,329,795,11602,195,456
11May 21, 2021 08:20271,5051,405,178,5111,330,374,34002,199,552
12May 21, 2021 08:19271,5551,395,905,2871,330,621,34202,183,168