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 17, 2021 23:47Yurkov AlekseyYurkov AlekseyScore: 674,110Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 17, 2021 23:47641,5673,205,059,7113,143,678,50502,240,512
2May 17, 2021 23:47641,6623,205,902,1293,144,144,07802,232,320
3May 17, 2021 23:47641,8463,199,269,4193,145,047,08202,228,224
4May 17, 2021 23:47642,1503,214,474,7963,146,536,01902,240,512
5May 17, 2021 23:47642,3453,219,470,4553,147,490,60202,236,416
6May 17, 2021 23:47642,4213,219,785,0733,147,860,56102,240,512
7May 17, 2021 23:47674,1103,373,195,4653,303,139,96702,236,416
8May 17, 2021 23:47674,2633,381,252,9063,303,889,49002,240,512
9May 17, 2021 23:47674,3363,372,194,0853,304,244,55702,228,224
10May 17, 2021 23:47674,3643,372,657,3243,304,383,48802,240,512
11May 17, 2021 23:47674,4133,366,353,7403,304,623,67302,244,608
12May 17, 2021 23:47674,4823,370,979,6243,304,962,11902,240,512