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 19:18Dmitry DolgopolovDmitry DolgopolovScore: 483,005Success
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 12:28444,3812,244,089,0912,177,468,60402,252,800
2May 21, 2021 19:18444,3912,241,569,1202,177,515,45102,252,800
3May 21, 2021 12:28444,3972,240,879,2732,177,544,66702,244,608
4May 21, 2021 19:18444,4052,247,315,4812,177,582,85202,265,088
5May 21, 2021 19:18444,4062,228,775,1102,177,590,13702,248,704
6May 21, 2021 12:28444,4122,228,356,3642,177,619,71402,252,800
7May 21, 2021 12:28483,0052,431,892,6562,366,726,82002,252,800
8May 21, 2021 19:18483,1162,426,651,6662,367,267,60002,256,896
9May 21, 2021 12:28483,1372,434,483,2242,367,373,61802,256,896
10May 21, 2021 19:18483,1382,436,515,0122,367,375,12902,260,992
11May 21, 2021 19:18483,1642,445,872,9322,367,503,47202,273,280
12May 21, 2021 12:28483,2212,442,316,9912,367,781,17202,248,704