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 listOct 18, 2024 16:03Sybrand AarnoutseSybrand AarnoutseScore: 1,008,043Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 18, 2024 16:031,005,2464,957,680,4124,923,706,0001,998,0002,289,664
2Oct 18, 2024 16:031,007,1684,966,964,3444,933,123,0001,998,0002,281,472
3Oct 18, 2024 16:031,007,5524,966,549,2284,934,007,0002,998,0002,277,376
4Oct 18, 2024 16:031,007,8414,966,314,0704,935,423,0002,997,0002,289,664
5Oct 18, 2024 16:031,008,0434,970,332,6704,937,412,0001,998,0002,265,088
6Oct 18, 2024 16:031,008,5864,971,183,6724,940,073,0001,998,0002,285,568
7Oct 18, 2024 16:031,008,7274,974,244,9234,940,762,0001,999,0002,281,472
8Oct 18, 2024 16:031,010,1304,981,590,6724,946,640,0002,997,0002,523,136
9Oct 18, 2024 16:031,010,6684,981,358,7004,949,275,0002,998,0002,289,664