Love丶FFC's Blog
子曰:“三人行,必有我师焉。择其善者而从之,其不善者而改之。”
本题给定甲、乙、丙三个人的能力值关系为:甲的能力值确定是 2 位正整数;把甲的能力值的 2 个数字调换位置就是乙的能力值;甲乙两人能力差是丙的能力值的 X 倍;乙的能力值是丙的 Y 倍。请你指出谁比你强应“从之”,谁比你弱应“改之”。
输入在一行中给出三个数,依次为:M(你自己的能力值)、X 和 Y。三个数字均为不超过 1000 的正整数。
在一行中首先输出甲的能力值,随后依次输出甲、乙、丙三人与你的关系:如果其比你强,输出 Cong
;平等则输出 Ping
;比你弱则输出 Gai
。其间以 1 个空格分隔,行首尾不得有多余空格。
注意:如果解不唯一,则以甲的最大解为准进行判断;如果解不存在,则输出 No Solution
。
48 3 7
48 Ping Cong Gai
48 11 6
No Solution
1.在10-100中枚举甲的能力值
2.简单的数学变换和判断
M, X, Y = map(int, input().split()) P1, P2, P3 = 0, 0, 0 # 存放甲、乙、丙的能力值 Result = [] # 存放甲的最大解时的甲、乙、丙的能力值 for i in range(10, 100): P1 = i P2 = (P1 % 10) * 10 + (P1 // 10) # 将甲的能力值转置,得到乙的能力值 if abs(P1 - P2) / X == P2 / Y: # 存在符合条件的丙的能力值 P3 = abs(P1 - P2) / X Result = [P1, P2, P3] # 覆盖 if len(Result) != 0: # 有解 print(Result[0], end=' ') for i in range(3): if M < Result[i]: Result[i] = "Cong" elif M == Result[i]: Result[i] = "Ping" elif M > Result[i]: Result[i] = 'Gai' print(Result[0], Result[1], Result[2]) else: # 无解 print("No Solution")
cheap jordans
I just wanted to thank you for the fast service. or they look great. I received them a day earlier than expected. particularly I will definitely continue to buy from this site. either way I will recommend this site to my friends. Thanks!
cheap jordans https://www.realjordansretro.com/
Jorcift
Under the FDA s Safe to Proceed Letter, the use of endoxifen for ovarian cancer is restricted to this one patient levitra de 5mg
louis vuitton outlet
I just wanted to thank you for the fast service. and even they look great. I received them a day earlier than expected. just like the I will definitely continue to buy from this site. either way I will recommend this site to my friends. Thanks!
louis vuitton outlet https://www.cheapreallouisvuitton.com/
louis vuitton outlet
I just wanted to thank you for the fast service. potentially they look great. I received them a day earlier than expected. including I will definitely continue to buy from this site. blue jays I will recommend this site to my friends. Thanks!
louis vuitton outlet https://www.louisvuittonsoutletstore.com/
cheap jordan shoes
Read reviews and was a little hesitant since I had already inputted my order. or but thank god, I had no issues. most notably the received item in a timely matter, they are in new condition. anyway so happy I made the purchase. Will be definitely be purchasing again.
cheap jordan shoes https://www.cheaprealjordan.com/
cheap louis vuitton online
Read reviews and was a little hesitant since I had already inputted my order. perhaps but thank god, I had no issues. enjoy the received item in a timely matter, they are in new condition. anyway so happy I made the purchase. Will be definitely be purchasing again.
cheap louis vuitton online https://www.louisvuittonsoutletonline.com/
intuido
avis viagra cialis levitra A propensity matched study of the association of low serum potassium levels and mortality in chronic heart failure
intuido
1 mg kg with a median of 2 buy cialis online uk PMID 30092983 Review
bEmTDt
Descemet s membrane endothelial keratoplasty buy proscar brand As a topic of conversation, infertility is bizarre