33分其它全是超时的,求救

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

love_python @ 2023-05-12 18:50:15

import math
a,b=map(int,input().split())
for i in range(a,b+1):
    for j in range(2,int(math.sqrt(i)+1)):
        if i%j==0:
            break
    else:

      if str(i)==str(i)[::-1]:
          print(i)

by hang2023 @ 2023-07-25 11:15:07

O2 看看能不能 66 分


|