热门

最新

红包

立Flag

投票

同城

我的

发布
leweyu
leweyu
4 年前
trueleweyu

https://www2.lauterbach.com/pdf/icd_tutorial.pdf

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
咋能超时了呢~ ```python import datetime #判断日期 def isyear(t): try: datetime.date(int(t[0:4]),int(t[4:6]),int(t[6:8])) return True except: return False def iscycle(t): #判断是否回文 if(int(t[0:4])==int(t[len(t)-1:len(t)-5:-1])): return True else: return False def isABcycle(t): #判断是否ABABBABA if(t[0]==t[2]==t[5]==t[7] and t[1]==t[3]==t[4]==t[6]): return True else: return False t=str(input()) a=0 b=0 for i in range(int(t)+1,100000000): if isyear(str(i)) and iscycle(str(i)): a=int(i) break for j in range(int(t)+1,100000000): if isyear(str(j)) and isABcycle(str(j)): b=int(j) break print(a) print(b) ```
立即登录