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 listJul 21, 2022 19:07Robert BurkeRobert BurkeScore: 74,263Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 19:0770,539402,743,809345,640,08102,285,568
2Jul 21, 2022 19:0770,569398,727,852345,789,01802,281,472
3Jul 21, 2022 19:3370,574411,615,719345,811,84902,289,664
4Jul 21, 2022 19:0770,579409,303,012345,835,34502,289,664
5Jul 21, 2022 19:3370,580402,228,000345,841,30702,281,472
6Jul 21, 2022 19:3370,629395,126,972346,084,05502,281,472
7Jul 21, 2022 19:0774,222390,150,094362,689,000999,0002,281,472
8Jul 21, 2022 19:3374,237387,302,803362,761,000999,0002,281,472
9Jul 21, 2022 19:3374,244388,962,359361,798,0001,998,0002,428,928
10Jul 21, 2022 19:3374,246386,835,462362,807,000999,0002,281,472
11Jul 21, 2022 19:0774,248389,285,163362,818,000999,0002,428,928
12Jul 21, 2022 19:3374,254389,885,117362,846,000999,0002,281,472
13Jul 21, 2022 19:0774,263389,324,232361,889,0001,999,0002,424,832
14Jul 21, 2022 19:3374,265385,658,714362,900,000999,0002,281,472
15Jul 21, 2022 19:3374,270388,891,232362,922,000999,0002,424,832
16Jul 21, 2022 19:3374,272385,986,564362,935,000999,0002,433,024
17Jul 21, 2022 19:3374,289391,080,812362,015,0002,000,0002,424,832
18Jul 21, 2022 19:0774,295385,776,451362,047,0002,000,0002,281,472
19Jul 21, 2022 19:0774,298388,484,024363,058,0001,000,0002,281,472
20Jul 21, 2022 19:0774,300385,398,901362,070,0002,000,0002,281,472
21Jul 21, 2022 19:0774,312385,830,495364,131,00002,281,472
22Jul 21, 2022 19:3374,333386,650,222364,233,00002,277,376
23Jul 21, 2022 19:0774,347389,569,977363,302,0001,000,0002,424,832
24Jul 21, 2022 19:0774,365386,147,777363,388,0001,001,0002,277,376