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:16Hal FHal FScore: 59,779Success
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:1659,590358,315,584291,992,95302,277,376
2Apr 27, 2024 12:1659,619355,852,125292,131,04102,269,184
3Apr 27, 2024 12:1659,700368,664,314292,530,17902,277,376
4Apr 27, 2024 12:1659,733320,556,501289,695,0002,996,0002,289,664
5Apr 27, 2024 12:1659,743315,721,636289,744,0002,997,0002,273,280
6Apr 27, 2024 12:1659,768319,624,808290,863,0001,999,0002,523,136
7Apr 27, 2024 12:1659,779319,608,979289,917,0002,999,0002,289,664
8Apr 27, 2024 12:1659,812315,412,090290,079,0003,000,0002,363,392
9Apr 27, 2024 12:1659,824313,197,248290,137,0003,001,0002,273,280
10Apr 27, 2024 12:1659,951319,139,777291,764,0001,998,0002,281,472
11Apr 27, 2024 12:1660,411319,717,466295,013,0001,000,0002,289,664
12Apr 27, 2024 12:1661,696324,920,586300,307,0002,002,0002,347,008