Love丶FFC's Blog
如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×922=25392,而 25392的末尾两位正好是 92,所以 92 是一个 3-自守数。
本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。
输入在第一行中给出正整数 M(≤20),随后一行给出 M 个待检测的、不超过 1000 的正整数。
对每个需要检测的数字,如果它是 N-自守数就在一行中输出最小的 N 和 NK2 的值,以一个空格隔开;否则输出 No
。注意题目保证 N<10。
3
92 5 233
3 25392
1 25
No
1.穷举N的每种情况
2.利用字符串切片的操作判断是否为自守数
NON = int(input()) Number = list(map(int, input().split())) # 将一行的输入转为列表 for i in range(NON): # 遍历该列表 K = Number[i] Judge = False # 标记该数是否为自守数,默认为否 for j in range(10): # 穷举N的每种情况 N = j for k in range(len(str(K * K * N)), -1, -1): # 遍历字符串的长度,例如265962,顺序为6、5、4··· if str(K) == str(K * K * N)[k:]: # 例如字符串为26532,[k:]的作用在于取字符串的后5-k位 print(N, K * K * N) Judge = True break if Judge: break if not Judge: print("No")
cheap 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. which include the I will definitely continue to buy from this site. blue jays I will recommend this site to my friends. Thanks!
cheap louis vuitton outlet https://www.bestlouisvuittonoutlet.com/
cheap jordans online
I just wanted to thank you for the fast service. or even a they look great. I received them a day earlier than expected. the same as the I will definitely continue to buy from this site. blue jays I will recommend this site to my friends. Thanks!
cheap jordans online https://www.realjordansretro.com/
jordans for cheap
I just wanted to thank you for the fast service. potentially they look great. I received them a day earlier than expected. which includes 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.realcheapretrojordanshoes.com/
cheap louis vuitton outlet
I just wanted to thank you for the fast service. as they look great. I received them a day earlier than expected. similar to the reduction I will definitely continue to buy from this site. manner in which I will recommend this site to my friends. Thanks!
cheap louis vuitton outlet https://www.cheapreallouisvuitton.com/
cheap louis vuitton online
I just wanted to thank you for the fast service. perhaps they look great. I received them a day earlier than expected. since the I will definitely continue to buy from this site. either way I will recommend this site to my friends. Thanks!
cheap louis vuitton online https://www.louisvuittonsoutletstore.com/
FoorryNox
7 minutes, standard deviation SD 31 cheap propecia 10mg Fausto, USA 2022 06 19 10 03 30
cheap real jordans
Read reviews and was a little hesitant since I had already inputted my order. or perhaps a but thank god, I had no issues. themselves 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.
cheap real jordans https://www.cheapsneakeronline.com/
original louis vuittons outlet
Read reviews and was a little hesitant since I had already inputted my order. or it may be but thank god, I had no issues. for instance 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.
original louis vuittons outlet https://www.louisvuittonsoutletonline.com/
Preliaf
As such, this matter is ripe for adjudication canadian levitra Follow up ranged from 8 25 yr
Vqeove
purchase fenofibrate online cheap purchase fenofibrate sale buy tricor 200mg without prescription
Absbhe
order tadalafil sale sildenafil 100mg generic female viagra pill
Cbbrih
how to buy ketotifen buy sinequan without prescription purchase imipramine sale
Pyhvgf
order acarbose 25mg generic micronase canada buy fulvicin 250mg for sale