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 11:52Hal FHal FScore: 58,780Success
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 11:5257,430361,927,488281,408,68902,273,280
2Apr 27, 2024 11:5257,446345,418,918281,483,54202,277,376
3Apr 27, 2024 11:5257,504340,349,286281,767,96002,265,088
4Apr 27, 2024 11:5258,654313,444,275285,404,0002,002,0002,383,872
5Apr 27, 2024 11:5258,670315,049,456285,487,0001,996,0002,277,376
6Apr 27, 2024 11:5258,763315,208,589284,938,0002,999,0002,289,664
7Apr 27, 2024 11:5258,780310,373,096285,021,0003,000,0002,289,664
8Apr 27, 2024 11:5258,782313,624,992287,033,0001,000,0002,289,664
9Apr 27, 2024 11:5258,784314,219,020285,042,0003,000,0002,523,136
10Apr 27, 2024 11:5258,867317,875,459286,447,0002,003,0002,269,184
11Apr 27, 2024 11:5258,875315,926,818286,490,0001,996,0002,289,664
12Apr 27, 2024 11:52128,585658,009,163627,067,0003,000,0002,523,136