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 listJan 22, 2024 08:27matsuoka-601matsuoka-601Score: 75,038Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 22, 2024 08:2771,724413,091,333351,449,66202,277,376
2Jan 22, 2024 08:2771,744420,405,007351,545,90802,273,280
3Jan 22, 2024 08:2771,766408,179,578351,653,50702,273,280
4Jan 22, 2024 08:2774,965397,938,960365,328,0002,001,0002,527,232
5Jan 22, 2024 08:2774,982398,120,438365,409,0002,002,0002,285,568
6Jan 22, 2024 08:2775,025395,272,081364,628,0002,996,0002,285,568
7Jan 22, 2024 08:2775,038390,463,892364,688,0002,997,0002,523,136
8Jan 22, 2024 08:2775,052393,523,355364,756,0002,997,0002,285,568
9Jan 22, 2024 08:2775,087391,001,399364,927,0002,999,0002,285,568
10Jan 22, 2024 08:2775,089391,346,268365,936,0001,999,0002,281,472
11Jan 22, 2024 08:2776,953399,345,460374,068,0003,000,0002,531,328
12Jan 22, 2024 08:2776,974404,463,015374,174,0003,001,0002,285,568