等会,我刚交的是观赏版
(不要问观赏版是什么,问就改bug顺便问问你们是怎么改bug ...
我拿您的代码去试试,如果通过即可领奖励 sfqxx 发表于 2023-1-26 17:12
我拿您的代码去试试,如果通过即可领奖励
。。那你还是用这个吧,我刚有个特殊判定没加上{:10_269:}
kinds = input()
m1,m2 = input().split()
splits = input().split()
m1 = int(m1)
m2 = int(m2)
time = set()
pri_m = set()
pri_tm = set()
for factor in range(2,m1+1):
if m1 % factor ==0:
ifadd = True
for f in pri_m:
if factor % f == 0:
ifadd = False
break
if ifadd:
tm = 0
while m1 % factor == 0:
m1 /= factor
tm += 1
pri_tm.add(tm)
pri_m.add(factor)
maxtm = max(pri_tm)*m2 if pri_tm else 0
for sp in splits:
sp = int(sp)
if len() == len(pri_m):
pri_ts = set()
for t in pri_m:
ts = 0
while sp % t == 0:
sp /= t
ts += 1
pri_ts.add(ts)
maxts= max(pri_ts) if pri_ts else 1
if maxtm % maxts == 0:
time.add(maxtm // maxts)
else:
for t in range(2,maxtm+1):
if maxts *t > maxtm:
time.add(t)
break
else:
time.add(-1)
time.discard(-1)
if time:
print(min(time))
else:
print(-1) hziyan 发表于 2023-1-26 17:45
。。那你还是用这个吧,我刚有个特殊判定没加上
恭喜,您通过了此题!
奖励即将送达{:10_279:}
页:
1
[2]