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 24, 2021 07:46alex3dalex3dScore: 585,516Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 07:41533,9392,692,235,2812,616,300,06002,277,376
2May 24, 2021 07:46533,9612,671,324,7682,616,410,52802,285,568
3May 24, 2021 07:41533,9642,677,326,4142,616,424,10402,277,376
4May 24, 2021 07:46533,9732,667,309,8542,616,467,16102,269,184
5May 24, 2021 07:46534,0162,696,976,8692,616,676,54002,277,376
6May 24, 2021 07:41534,0542,686,269,7532,616,864,13802,273,280
7May 24, 2021 07:46585,5162,925,994,9792,869,027,53902,269,184
8May 24, 2021 07:41585,5492,934,087,2052,869,188,03002,273,280
9May 24, 2021 07:46585,7312,939,399,2552,870,083,36402,277,376
10May 24, 2021 07:41585,7742,927,640,3682,870,292,14402,265,088
11May 24, 2021 07:41585,9732,939,162,6732,871,268,20702,273,280
12May 24, 2021 07:46586,3782,936,314,4432,873,252,32102,273,280