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 listJun 13, 2024 12:06matsuoka-601matsuoka-601Score: 66,153Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 13, 2024 12:0664,359341,578,891293,403,00021,955,0002,498,560
2Jun 13, 2024 12:0664,425341,745,675295,704,00019,980,0002,486,272
3Jun 13, 2024 12:0664,426342,086,531291,710,00023,976,0002,486,272
4Jun 13, 2024 12:0664,434347,395,915292,747,00022,980,0002,375,680
5Jun 13, 2024 12:0664,869345,992,305293,869,00023,989,0002,371,584
6Jun 13, 2024 12:0665,295351,482,420300,948,00018,996,0002,371,584
7Jun 13, 2024 12:0666,153351,899,888294,230,00029,921,0002,490,368
8Jun 13, 2024 12:0666,404367,610,343303,422,00021,958,0002,367,488
9Jun 13, 2024 12:0673,718389,573,925336,272,00024,946,0002,371,584
10Jun 13, 2024 12:0695,294533,652,504466,938,58802,215,936
11Jun 13, 2024 12:0695,315564,338,912467,044,22702,215,936
12Jun 13, 2024 12:0695,441530,680,048467,663,34502,215,936