22分超时,求大佬帮改(˚ ˃̣̣̥᷄⌓˂̣̣̥᷅ )

P1217 [USACO1.5] 回文质数 Prime Palindromes

Rabod @ 2024-02-29 22:56:23

import math l=list(map(int,input().split())) for i in range(l[0],l[1],2): n = 0 p = 0 for j in range(2,math.ceil(i/2)): if i%j==0: n+=1 if n==0: hp=str(i) for o in range(len(hp)): if hp[o]!=hp[len(hp)-1-o]: p=1 break if p==0: print(i)


by cff_0102 @ 2024-03-01 00:09:00

希望更丰富的展现?使用 Markdown、KaTeX。


by fanjiayu666 @ 2024-03-01 16:27:15

@cff_0102 ???


|