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 19, 2021 22:08Mikhail ShirokovMikhail ShirokovScore: 4,970,088Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 22:084,849,29631,734,769,67523,761,549,75602,220,032
2May 19, 2021 22:084,849,83031,977,288,28823,764,167,95402,232,320
3May 19, 2021 22:084,875,83031,535,801,27323,891,569,36402,220,032
4May 19, 2021 22:084,966,14432,284,256,47924,334,105,02702,203,648
5May 19, 2021 22:084,970,08832,741,907,77924,353,433,60402,228,224
6May 19, 2021 22:084,970,76632,682,874,63624,356,751,23902,183,168
7May 19, 2021 22:084,980,04132,777,004,44724,402,201,04202,252,800
8May 19, 2021 22:084,985,57031,991,705,47324,429,292,04402,179,072
9May 19, 2021 22:084,993,24633,076,490,12524,466,904,93202,179,072