結果
問題 | No.491 10^9+1と回文 |
ユーザー |
![]() |
提出日時 | 2020-01-02 13:34:03 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,195 bytes |
コンパイル時間 | 443 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 89,572 KB |
最終ジャッジ日時 | 2024-11-22 18:00:12 |
合計ジャッジ時間 | 78,309 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 MLE * 1 |
other | AC * 52 WA * 31 TLE * 12 MLE * 8 |
ソースコード
from itertools import *from bisect import *#from math import *from collections import *from heapq import *from random import *from decimal import *import numpy as npimport syssys.setrecursionlimit(10 ** 6)int1 = lambda x: int(x) - 1p2D = lambda x: print(*x, sep="\n")def II(): return int(sys.stdin.readline())def MI(): return map(int, sys.stdin.readline().split())def MI1(): return map(int1, sys.stdin.readline().split())def MF(): return map(float, sys.stdin.readline().split())def LI(): return list(map(int, sys.stdin.readline().split()))def LI1(): return list(map(int1, sys.stdin.readline().split()))def LF(): return list(map(float, sys.stdin.readline().split()))def LLI(rows_number): return [LI() for _ in range(rows_number)]dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]def main():def issym(a):s=str(a)if s==s[::-1]:return Truereturn Falses=input()n=int(s)if n<10**9+1:print(0)exit()k=len(s)-9ans=0for i in range(1,k):ans+=10**((i+1)//2)-1for x in range(10**(k-1),10**k):a=x*1000000001if a>n:breakif issym(a):ans+=1print(ans)main()