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 21:47Mikhail ShirokovMikhail ShirokovScore: 6,265,496Success
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 21:476,126,92030,081,479,18730,021,909,53102,252,800
2May 19, 2021 21:476,133,86830,115,431,06930,055,955,48102,256,896
3May 19, 2021 21:476,135,29730,119,076,83030,062,956,84002,260,992
4May 19, 2021 21:476,264,88030,752,773,54030,697,910,88402,252,800
5May 19, 2021 21:476,265,49630,792,807,16630,700,931,42402,256,896
6May 19, 2021 21:476,265,92630,759,518,26330,703,039,14702,256,896
7May 19, 2021 21:476,266,19430,767,787,96230,704,348,34602,244,608
8May 19, 2021 21:476,267,20230,763,924,06630,709,292,19902,256,896
9May 19, 2021 21:476,267,43730,767,523,61130,710,439,71102,260,992