Technology Sharing

Huawei OD computer test questions (HJ41 weighing weights)

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Preface

After the initial data structure and algorithm learning, I started to use OD computer test questions as practice questions to continue to improve my proficiency. If necessary, you can practice simultaneously.

describe

There are n kinds of weights with different weights, namely m1, m2, m3…mn;
The number of each weight is x1, x2, x3... xn. Now we need to use these weights to weigh objects (put them on the same side). How many different weights can be weighed?

Note: The weighing weight includes 0

Data range: Each set of input data meets