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 listFeb 17, 2024 15:46Huy Duc LeHuy Duc LeScore: 141,824Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 17, 2024 15:46138,759702,766,195677,918,0001,999,0002,289,664
2Feb 17, 2024 15:46138,865709,272,787679,440,000999,0002,523,136
3Feb 17, 2024 15:46138,885705,701,370677,541,0002,997,0002,519,040
4Feb 17, 2024 15:46139,026707,486,568680,229,0001,000,0002,519,040
5Feb 17, 2024 15:46139,066711,250,296679,424,0001,998,0002,523,136
6Feb 17, 2024 15:46139,554707,657,514680,817,0002,999,0002,289,664
7Feb 17, 2024 15:46141,824722,148,768691,938,0002,999,0002,527,232
8Feb 17, 2024 15:46141,861716,595,864692,120,0003,000,0002,523,136
9Feb 17, 2024 15:46142,956726,799,033696,487,0003,997,0002,289,664
10Feb 17, 2024 15:46159,504842,315,758781,569,31702,273,280
11Feb 17, 2024 15:46160,086854,604,464784,422,74602,273,280
12Feb 17, 2024 15:46161,798853,121,112792,811,62402,265,088