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 27, 2024 13:37Hal FHal FScore: 57,449Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 13:3755,127327,445,314270,122,58602,273,280
2Apr 27, 2024 13:3755,291347,111,738270,927,12502,273,280
3Apr 27, 2024 13:3755,767330,315,175273,259,46002,277,376
4Apr 27, 2024 13:3757,308306,966,239277,810,0002,997,0002,289,664
5Apr 27, 2024 13:3757,334303,601,651277,936,0002,999,0002,265,088
6Apr 27, 2024 13:3757,417305,489,135280,340,0001,001,0002,289,664
7Apr 27, 2024 13:3757,449313,709,221280,498,0001,001,0002,265,088
8Apr 27, 2024 13:3757,816305,589,312281,297,0002,002,0002,523,136
9Apr 27, 2024 13:3757,827305,162,456281,351,0002,002,0002,289,664
10Apr 27, 2024 13:3757,865315,100,473282,536,0001,001,0002,289,664
11Apr 27, 2024 13:3758,270312,504,797283,518,0002,003,0002,265,088
12Apr 27, 2024 13:3761,089326,011,084297,335,0002,002,0002,523,136