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 listNov 20, 2024 05:32NoSIMD_C#NoSIMD_C#Score: 1,242,520Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 20, 2024 05:321,241,4446,116,843,4085,979,125,000103,950,0002,539,520
2Nov 20, 2024 05:321,241,6876,117,711,0075,979,314,000104,952,0002,297,856
3Nov 20, 2024 05:321,241,9936,113,378,2605,982,822,000102,945,0002,297,856
4Nov 20, 2024 05:321,242,2226,116,470,7135,981,942,000104,946,0002,535,424
5Nov 20, 2024 05:321,242,5206,115,786,1225,973,401,000114,949,0002,293,760
6Nov 20, 2024 05:321,242,6076,121,406,5465,991,826,00096,948,0002,289,664
7Nov 20, 2024 05:321,242,6986,124,747,3085,980,306,000108,914,0002,306,048
8Nov 20, 2024 05:321,243,0366,123,549,1455,982,933,000107,944,0002,306,048
9Nov 20, 2024 05:321,243,6926,130,222,9405,991,172,000102,917,0002,539,520