結果

問題 No.491 10^9+1と回文
ユーザー McGregorshMcGregorsh
提出日時 2022-10-30 09:04:31
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 1,703 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 92,720 KB
最終ジャッジ日時 2023-09-21 08:48:26
合計ジャッジ時間 31,700 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 MLE -
testcase_02 MLE -
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 MLE -
testcase_29 MLE -
testcase_30 MLE -
testcase_31 MLE -
testcase_32 MLE -
testcase_33 MLE -
testcase_34 MLE -
testcase_35 MLE -
testcase_36 MLE -
testcase_37 MLE -
testcase_38 MLE -
testcase_39 MLE -
testcase_40 MLE -
testcase_41 MLE -
testcase_42 MLE -
testcase_43 MLE -
testcase_44 MLE -
testcase_45 MLE -
testcase_46 MLE -
testcase_47 MLE -
testcase_48 MLE -
testcase_49 MLE -
testcase_50 MLE -
testcase_51 MLE -
testcase_52 MLE -
testcase_53 MLE -
testcase_54 MLE -
testcase_55 MLE -
testcase_56 MLE -
testcase_57 MLE -
testcase_58 MLE -
testcase_59 MLE -
testcase_60 MLE -
testcase_61 MLE -
testcase_62 MLE -
testcase_63 MLE -
testcase_64 MLE -
testcase_65 MLE -
testcase_66 MLE -
testcase_67 MLE -
testcase_68 MLE -
testcase_69 MLE -
testcase_70 MLE -
testcase_71 MLE -
testcase_72 MLE -
testcase_73 MLE -
testcase_74 MLE -
testcase_75 MLE -
testcase_76 MLE -
testcase_77 MLE -
testcase_78 MLE -
testcase_79 MLE -
testcase_80 MLE -
testcase_81 MLE -
testcase_82 MLE -
testcase_83 MLE -
testcase_84 MLE -
testcase_85 MLE -
testcase_86 MLE -
testcase_87 MLE -
testcase_88 MLE -
testcase_89 MLE -
testcase_90 MLE -
testcase_91 MLE -
testcase_92 MLE -
testcase_93 MLE -
testcase_94 MLE -
testcase_95 MLE -
testcase_96 MLE -
testcase_97 MLE -
testcase_98 MLE -
testcase_99 MLE -
testcase_100 MLE -
testcase_101 MLE -
testcase_102 MLE -
testcase_103 MLE -
testcase_104 MLE -
testcase_105 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re
from fractions import Fraction
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque, defaultdict
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement, permutations
from bisect import bisect, bisect_left, bisect_right
from functools import reduce, lru_cache
from decimal import Decimal, getcontext, ROUND_HALF_UP
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
def get_distance(x1, y1, x2, y2):
	  d = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
	  return d
def rotate(table):
   	  n_fild = []
   	  for x in zip(*table[::-1]):
   	  	  n_fild.append(x)
   	  return n_fild
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
MOD = 10 ** 9 + 7
MOD2 = 998244353


###関数コピーしたか?###
def main():
   
   N = int(input())
   
   ans = 0
   for i in range(1, 10):
   	  if N >= i * 1000000001:
   	  	  ans += 1
   
   for i in range(1, 1000):
   	  a = str(i) 
   	  b = a[::-1]
   	  mozi = (max(8 - len(a), 0))
   	  c = a + b + '0' * mozi + a + b
   	  c = int(c)
   	  if N >= c:
   	  	  ans += 1
   print(ans)
   
if __name__ == '__main__':
    main()
0