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 listApr 25, 2024 22:48Hal FHal FScore: 55,348Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 22:4854,456333,372,760266,834,36402,269,184
2Apr 25, 2024 22:4854,539333,982,119267,238,70302,277,376
3Apr 25, 2024 22:4854,541334,362,074267,251,39202,281,472
4Apr 25, 2024 22:4854,983293,188,026267,416,0002,003,0002,355,200
5Apr 25, 2024 22:4855,037302,100,887268,682,000998,0002,289,664
6Apr 25, 2024 22:4855,331297,641,710268,121,0003,001,0002,289,664
7Apr 25, 2024 22:4855,348303,058,327269,206,0002,001,0002,531,328
8Apr 25, 2024 22:4855,400302,262,961270,458,0001,001,0002,289,664
9Apr 25, 2024 22:4855,439303,179,878268,653,0002,996,0002,289,664
10Apr 25, 2024 22:4855,445294,062,639269,683,0001,997,0002,289,664
11Apr 25, 2024 22:4855,457297,913,484269,741,0001,998,0002,289,664
12Apr 25, 2024 22:4855,573297,629,981270,308,0002,002,0002,289,664