結果
問題 | No.491 10^9+1と回文 |
ユーザー | mkawa2 |
提出日時 | 2020-01-02 15:45:55 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,158 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 81,452 KB |
最終ジャッジ日時 | 2024-12-20 16:57:49 |
合計ジャッジ時間 | 63,221 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 726 ms
44,664 KB |
testcase_01 | AC | 528 ms
44,664 KB |
testcase_02 | AC | 519 ms
44,540 KB |
testcase_03 | AC | 544 ms
44,404 KB |
testcase_04 | AC | 524 ms
44,540 KB |
testcase_05 | AC | 533 ms
44,664 KB |
testcase_06 | AC | 522 ms
44,536 KB |
testcase_07 | AC | 539 ms
44,796 KB |
testcase_08 | AC | 530 ms
44,796 KB |
testcase_09 | AC | 540 ms
44,664 KB |
testcase_10 | AC | 541 ms
44,532 KB |
testcase_11 | AC | 528 ms
44,660 KB |
testcase_12 | AC | 540 ms
44,680 KB |
testcase_13 | AC | 542 ms
44,660 KB |
testcase_14 | AC | 554 ms
44,544 KB |
testcase_15 | AC | 555 ms
44,408 KB |
testcase_16 | AC | 553 ms
44,408 KB |
testcase_17 | AC | 551 ms
44,536 KB |
testcase_18 | AC | 545 ms
44,660 KB |
testcase_19 | AC | 532 ms
44,404 KB |
testcase_20 | AC | 535 ms
44,788 KB |
testcase_21 | AC | 543 ms
44,540 KB |
testcase_22 | AC | 536 ms
44,676 KB |
testcase_23 | AC | 542 ms
44,668 KB |
testcase_24 | AC | 542 ms
44,412 KB |
testcase_25 | AC | 547 ms
44,408 KB |
testcase_26 | AC | 547 ms
44,660 KB |
testcase_27 | AC | 548 ms
44,668 KB |
testcase_28 | AC | 549 ms
44,668 KB |
testcase_29 | AC | 540 ms
44,536 KB |
testcase_30 | AC | 543 ms
44,536 KB |
testcase_31 | AC | 539 ms
44,536 KB |
testcase_32 | AC | 552 ms
44,412 KB |
testcase_33 | AC | 545 ms
44,548 KB |
testcase_34 | AC | 549 ms
44,404 KB |
testcase_35 | AC | 536 ms
44,460 KB |
testcase_36 | AC | 556 ms
44,792 KB |
testcase_37 | AC | 546 ms
44,532 KB |
testcase_38 | AC | 541 ms
44,676 KB |
testcase_39 | AC | 536 ms
44,408 KB |
testcase_40 | AC | 537 ms
44,800 KB |
testcase_41 | AC | 527 ms
44,664 KB |
testcase_42 | AC | 525 ms
44,544 KB |
testcase_43 | AC | 542 ms
44,788 KB |
testcase_44 | AC | 527 ms
44,784 KB |
testcase_45 | AC | 525 ms
44,664 KB |
testcase_46 | AC | 543 ms
44,788 KB |
testcase_47 | AC | 535 ms
44,792 KB |
testcase_48 | AC | 573 ms
44,536 KB |
testcase_49 | AC | 537 ms
44,660 KB |
testcase_50 | AC | 537 ms
44,404 KB |
testcase_51 | AC | 530 ms
44,404 KB |
testcase_52 | AC | 543 ms
44,532 KB |
testcase_53 | AC | 543 ms
44,544 KB |
testcase_54 | AC | 550 ms
44,536 KB |
testcase_55 | AC | 550 ms
44,664 KB |
testcase_56 | AC | 543 ms
44,788 KB |
testcase_57 | AC | 552 ms
44,664 KB |
testcase_58 | AC | 573 ms
44,664 KB |
testcase_59 | AC | 544 ms
44,668 KB |
testcase_60 | AC | 545 ms
44,532 KB |
testcase_61 | AC | 542 ms
44,536 KB |
testcase_62 | AC | 534 ms
44,788 KB |
testcase_63 | AC | 542 ms
44,676 KB |
testcase_64 | AC | 528 ms
44,404 KB |
testcase_65 | AC | 538 ms
44,544 KB |
testcase_66 | AC | 536 ms
44,668 KB |
testcase_67 | AC | 540 ms
44,788 KB |
testcase_68 | AC | 536 ms
44,552 KB |
testcase_69 | AC | 536 ms
44,616 KB |
testcase_70 | AC | 536 ms
44,664 KB |
testcase_71 | AC | 549 ms
44,536 KB |
testcase_72 | AC | 547 ms
44,656 KB |
testcase_73 | AC | 585 ms
44,676 KB |
testcase_74 | AC | 542 ms
44,536 KB |
testcase_75 | AC | 547 ms
44,672 KB |
testcase_76 | AC | 544 ms
44,576 KB |
testcase_77 | AC | 534 ms
44,532 KB |
testcase_78 | AC | 541 ms
44,796 KB |
testcase_79 | AC | 548 ms
44,668 KB |
testcase_80 | AC | 545 ms
44,668 KB |
testcase_81 | AC | 543 ms
44,668 KB |
testcase_82 | AC | 531 ms
44,532 KB |
testcase_83 | AC | 530 ms
44,672 KB |
testcase_84 | AC | 535 ms
44,640 KB |
testcase_85 | AC | 542 ms
44,660 KB |
testcase_86 | AC | 535 ms
44,664 KB |
testcase_87 | AC | 534 ms
44,664 KB |
testcase_88 | AC | 544 ms
44,796 KB |
testcase_89 | AC | 543 ms
44,404 KB |
testcase_90 | AC | 535 ms
44,664 KB |
testcase_91 | AC | 536 ms
44,536 KB |
testcase_92 | AC | 528 ms
44,412 KB |
testcase_93 | AC | 536 ms
44,664 KB |
testcase_94 | AC | 539 ms
44,784 KB |
testcase_95 | AC | 532 ms
44,412 KB |
testcase_96 | AC | 539 ms
44,540 KB |
testcase_97 | AC | 541 ms
44,788 KB |
testcase_98 | AC | 535 ms
44,536 KB |
testcase_99 | AC | 541 ms
44,792 KB |
testcase_100 | AC | 532 ms
44,408 KB |
testcase_101 | AC | 544 ms
44,664 KB |
testcase_102 | AC | 528 ms
44,540 KB |
testcase_103 | AC | 530 ms
44,664 KB |
testcase_104 | AC | 533 ms
44,788 KB |
testcase_105 | MLE | - |
ソースコード
from itertools import * from bisect import * #from math import * from collections import * from heapq import * from random import * from decimal import * import numpy as np import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = 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(): s=input() n=int(s) if n<10**9+1: print(0) exit() k=len(s)-9 ans=0 for i in range(1,k): fw=(i+1)//2 ans+=10**fw-10**(fw-1) #print(i,10**fw-10**(fw-1)) ans+=int(s[:(k+1)//2])-(10**((k-1)//2)-1) sym=int(s[:(k+1)//2]+s[:k//2][::-1])*1000000001 if sym>n:ans-=1 print(ans) main()