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,300,506Success
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:321,210,1085,985,764,5455,929,527,56302,269,184
2May 6, 2021 20:331,221,4256,047,382,5265,984,980,17302,269,184
3May 6, 2021 20:321,253,0126,207,655,6726,139,759,84402,256,896
4May 6, 2021 20:321,256,2136,225,306,7766,155,442,47502,273,280
5May 6, 2021 20:331,257,5806,226,499,1296,162,139,56902,273,280
6May 6, 2021 20:331,260,0636,232,693,3196,174,310,02002,277,376
7May 6, 2021 20:331,300,5066,430,138,0526,372,479,65902,269,184
8May 6, 2021 20:331,302,7196,450,074,6186,383,323,96802,260,992
9May 6, 2021 20:321,306,0576,462,033,0296,399,679,73102,260,992
10May 6, 2021 20:331,308,1606,473,156,3726,409,982,17602,260,992
11May 6, 2021 20:321,310,5746,485,520,8226,421,814,49302,269,184
12May 6, 2021 20:321,311,2886,493,051,3626,425,309,16102,265,088