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 28, 2024 21:05Hal FHal FScore: 53,065Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:0552,382320,240,717256,671,91102,273,280
2Apr 28, 2024 21:0552,678317,451,157258,121,64402,277,376
3Apr 28, 2024 21:0552,826285,375,842256,851,0001,998,0002,289,664
4Apr 28, 2024 21:0552,987287,248,148257,638,0001,997,0002,289,664
5Apr 28, 2024 21:0553,002286,299,811256,714,0002,996,0002,289,664
6Apr 28, 2024 21:0553,059283,291,399257,992,0001,999,0002,265,088
7Apr 28, 2024 21:0553,065287,358,085258,018,0002,000,0002,527,232
8Apr 28, 2024 21:0553,123282,620,723258,299,0002,002,0002,371,584
9Apr 28, 2024 21:0553,760296,240,539262,424,0001,001,0002,531,328
10Apr 28, 2024 21:0553,843347,408,158263,832,89002,269,184
11Apr 28, 2024 21:0559,136316,151,674286,768,0002,997,0002,289,664
12Apr 28, 2024 21:0569,976365,814,670341,882,000999,0002,289,664