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 1, 2021 10:18gchebanovgchebanovScore: 188,910Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 1, 2021 10:18151,514796,510,581742,418,36402,269,184
2Jul 1, 2021 09:40151,614814,420,422742,909,95902,256,896
3Jul 1, 2021 10:18151,732809,128,586743,488,62502,265,088
4Jul 1, 2021 09:40151,810809,476,907743,869,99802,256,896
5Jul 1, 2021 10:18153,374829,895,468751,532,33002,256,896
6Jul 1, 2021 09:40154,114827,102,639755,156,90102,265,088
7Jul 1, 2021 09:40188,805950,941,375924,146,0001,000,0002,433,024
8Jul 1, 2021 10:18188,835952,617,475923,293,0001,998,0002,433,024
9Jul 1, 2021 09:40188,845954,297,829924,343,000999,0002,392,064
10Jul 1, 2021 10:18188,858953,794,902924,405,000999,0002,441,216
11Jul 1, 2021 10:18188,874951,021,834924,483,000999,0002,514,944
12Jul 1, 2021 09:40188,888950,344,768923,553,0001,999,0002,404,352
13Jul 1, 2021 09:40188,910946,151,116924,662,000999,0002,527,232
14Jul 1, 2021 10:18188,953947,888,620924,871,000999,0002,416,640
15Jul 1, 2021 09:40188,976952,701,198923,987,0001,997,0002,523,136
16Jul 1, 2021 09:40188,982947,688,075925,013,0001,000,0002,412,544
17Jul 1, 2021 10:18188,993949,892,474924,064,0002,000,0002,396,160
18Jul 1, 2021 10:18188,997950,910,623925,086,0001,000,0002,424,832
19Jul 1, 2021 09:40189,282956,708,391926,482,000999,0002,514,944
20Jul 1, 2021 09:40189,328951,200,811925,710,0001,999,0002,408,448
21Jul 1, 2021 10:18189,343949,375,144926,782,000999,0002,400,256
22Jul 1, 2021 09:40189,355954,968,549926,841,000999,0002,506,752
23Jul 1, 2021 10:18189,396953,691,416928,038,00002,527,232
24Jul 1, 2021 10:18189,471953,680,408927,408,000999,0002,420,736