HBC237460[HNOI2005]汤姆的游戏,二分,计算几何,分治Coins题解

北笙凉宸 算法基础篇 83 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
Alice has 444 types of coins. The values of the 444 types of coins are 2,3,17,192, 3, 17, 192,3,17,19, respectively. Each kind of coin has an unlimited supply. Bob also has 444 types of coins. The values of the 444 types of coins are 5,7,11,135, 7, 11, 135,7,11,13, respectively. Each kind of coin has an unlimited supply. There are qqq queries. The jjj-th query is described as an integer number xxx. The answer to the query is the minimum number of coins that is necessary to obtain the value xxx using some subset of coins . If it is impossible to obtain the value, the answer to the jjj-th query is 1-11. If both of them can obtain the minimum number, output"both".In the other case, you should output either "A" if Alicecan obtain the minimum number or "B" if Bobcan obtain the minimum number.

Alice has 444 types of coins. The values of the 444 types of coins are 2,3,17,192, 3, 17, 192,3,17,19, respectively. Each kind of coin has an unlimited supply. Bob also has 444 types of coins. The values of the 444 types of coins are 5,7,11,135, 7, 11, 135,7,11,13, respectively. Each kind of coin has an unlimited supply. There are qqq queries. The jjj-th query is described as an integer number xxx. The answer to the query is the minimum number of coins that is necessary to obtain the value xxx using some subset of coins (Alice or Bob). If it is impossible to obtain the value, the answer to the jjj-th query is −1-1−1. If both of them can obtain the minimum number, output "both". In the other case, you should output either "A" if Alice can obtain the minimum number or "B" if Bob can obtain the minimum number. 

HBC237460[HNOI2005]汤姆的游戏,二分,计算几何,分治Coins题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC237460[HNOI2005]汤姆的游戏 二分 计算几何 分治Coins题解