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 12:47Hal FHal FScore: 58,240Success
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 12:4753,964327,999,148264,425,96002,285,568
2Apr 27, 2024 12:4754,046328,940,702264,827,63902,277,376
3Apr 27, 2024 12:4758,121337,089,880284,792,78802,285,568
4Apr 27, 2024 12:4758,173308,262,816282,046,0003,000,0002,523,136
5Apr 27, 2024 12:4758,213309,288,898283,243,0002,001,0002,289,664
6Apr 27, 2024 12:4758,227306,687,638282,308,0003,003,0002,269,184
7Apr 27, 2024 12:4758,240306,448,068283,376,0002,002,0002,289,664
8Apr 27, 2024 12:4758,339314,252,591282,861,0002,998,0002,277,376
9Apr 27, 2024 12:4758,990313,578,543286,052,0003,000,0002,289,664
10Apr 27, 2024 12:4759,018312,390,789286,186,0003,001,0002,265,088
11Apr 27, 2024 12:4759,083323,131,208287,506,0002,003,0002,281,472
12Apr 27, 2024 12:4759,801319,666,121291,024,0002,000,0002,289,664