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 10, 2021 21:13Sergey StreminSergey StreminScore: 497,151Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 10, 2021 21:13434,1202,187,261,1812,127,187,88902,183,168
2May 10, 2021 21:13434,1362,202,859,5602,127,267,34502,203,648
3May 10, 2021 21:13434,1692,184,417,0862,127,430,23002,195,456
4May 10, 2021 21:13434,4032,203,372,0042,128,574,31002,195,456
5May 10, 2021 21:13434,4582,201,521,4072,128,844,87902,203,648
6May 10, 2021 21:13434,5822,189,291,1582,129,449,47402,195,456
7May 10, 2021 21:13497,1512,505,022,9172,436,038,52602,195,456
8May 10, 2021 21:13497,3182,491,784,6962,436,859,86602,203,648
9May 10, 2021 21:13497,4532,494,028,2622,437,520,95902,195,456
10May 10, 2021 21:13497,8322,507,446,3622,439,376,38502,199,552
11May 10, 2021 21:13497,8322,517,926,3212,439,374,78802,199,552
12May 10, 2021 21:13498,0462,513,831,5352,440,426,80002,195,456