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 19:00Hal FHal FScore: 57,130Success
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 19:0054,617337,983,062267,623,85302,273,280
2Apr 27, 2024 19:0054,684326,174,059267,952,72702,281,472
3Apr 27, 2024 19:0054,734336,898,051268,196,96702,281,472
4Apr 27, 2024 19:0057,029303,820,259276,448,0002,994,0002,289,664
5Apr 27, 2024 19:0057,091304,020,532276,750,0002,997,0002,523,136
6Apr 27, 2024 19:0057,115306,864,537276,867,0002,998,0002,527,232
7Apr 27, 2024 19:0057,130306,170,121276,936,0002,999,0002,273,280
8Apr 27, 2024 19:0057,427305,473,340279,390,0002,002,0002,269,184
9Apr 27, 2024 19:0057,450308,574,352279,502,0002,003,0002,523,136
10Apr 27, 2024 19:0057,455307,143,526279,535,0001,996,0002,289,664
11Apr 27, 2024 19:0057,491307,176,421278,711,0002,996,0002,289,664
12Apr 27, 2024 19:0058,310314,143,599284,719,0001,002,0002,289,664