Love丶FFC's Blog
设计函数求一元多项式的导数。(注:xn(n为整数)的一阶导数为nxn−1。)
以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过 1000 的整数)。数字间以空格分隔。
以与输入相同的格式输出导数多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。注意“零多项式”的指数和系数都是 0,但是表示为 0 0
。
3 4 -5 2 6 1 -2 0
12 3 -10 1 6 0
1.因为题目的输入是递减的多项式,所以一旦发现某个多项式指数小于等于0就要结束求导,只输出之前的结果
2.创建两个列表存放系数、指数,再创建一个列表存放求导后的多项式结果
3.对具体的情况进行判断
Number = list(map(int, input().split())) Coefficient, Index = list(), list() # 存放多项式的系数、指数 Derivative = list() for i in range(len(Number)): if i % 2 == 0: Coefficient.append(Number[i]) # 存放系数 else: Index.append(Number[i]) # 存放指数 for i in range(len(Coefficient)): if Coefficient[i] != 0 and Index[i] != 0: Coefficient[i] *= Index[i] Index[i] -= 1 Derivative.append([Coefficient[i], Index[i]]) # 存放求导后的多项式 elif Coefficient[i] == 0: Coefficient[i], Index[i] = 0, 0 Derivative.append([Coefficient[i], Index[i]]) # 存放求导后的多项式 if len(Derivative) == 0: # 首项的指数就小于等于0,导致后续多项式不再求导,这种情况需要输出0 0 print(0, 0) else: for i in range(len(Derivative)): if i != len(Derivative) - 1: print(Derivative[i][0], Derivative[i][1], end=' ') else: print(Derivative[i][0], Derivative[i][1])
fruinly
does propecia really work Nausea and vomiting due to chemotherapy 2 grams of taurine daily for 6 months has been used
cheap jordan shoes
I just wanted to thank you for the fast service. or possibly a they look great. I received them a day earlier than expected. the same as I will definitely continue to buy from this site. situation I will recommend this site to my friends. Thanks!
cheap jordan shoes https://www.realcheapretrojordanshoes.com/
jordans for cheap
I just wanted to thank you for the fast service. perhaps they look great. I received them a day earlier than expected. including the I will definitely continue to buy from this site. in any event I will recommend this site to my friends. Thanks!
jordans for cheap https://www.realjordansretro.com/
cheap louis vuitton handbags
I just wanted to thank you for the fast service. or maybe they look great. I received them a day earlier than expected. themselves I will definitely continue to buy from this site. in any event I will recommend this site to my friends. Thanks!
cheap louis vuitton handbags https://www.louisvuittonsoutletstore.com/
FoorryNox
So what is responsible for keeping muscle on the body propecia on sale Body mass index BMI was calculated as weight kg divided by the square of height m 2
cheap jordans online
Read reviews and was a little hesitant since I had already inputted my order. or but thank god, I had no issues. including received item in a timely matter, they are in new condition. an invaluable so happy I made the purchase. Will be definitely be purchasing again.
cheap jordans online https://www.cheapjordanssneakers.com/
jordans for cheap
Read reviews and was a little hesitant since I had already inputted my order. properly but thank god, I had no issues. the same as received item in a timely matter, they are in new condition. in any event so happy I made the purchase. Will be definitely be purchasing again.
jordans for cheap https://www.cheapauthenticjordans.com/
authentic louis vuitton outlet
Read reviews and was a little hesitant since I had already inputted my order. on the other hand but thank god, I had no issues. for instance received item in a timely matter, they are in new condition. manner in which so happy I made the purchase. Will be definitely be purchasing again.
authentic louis vuitton outlet https://www.louisvuittonsoutletonline.com/
cheap real jordans
Read reviews and was a little hesitant since I had already inputted my order. or maybe but thank god, I had no issues. for instance received item in a timely matter, they are in new condition. situation so happy I made the purchase. Will be definitely be purchasing again.
cheap real jordans https://www.realjordansshoes.com/
Preliaf
Inhibition of HIF 1 and wild type p53 stimulated transcription by codon Arg175 p53 mutants with selective loss of functions cialis 20mg price