結果

問題 No.491 10^9+1と回文
ユーザー tsubame
提出日時 2017-04-01 20:24:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 333 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-07 19:00:58
合計ジャッジ時間 5,061 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 58 WA * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python

N = int(input())
top = N // 1000000001
count = 0

k = len(str(top))

for i in range(1, k):
    count += 9 * 10 ** ((i - 1) // 2)
keta = (k + 1) // 2
ue = str(top)[:keta]
sita = str(top)[::-1][-keta:]
count +=  int(ue) - 10 ** (keta - 1) + 1
if int(ue[::-1]) > int(sita):
    count -= 1
print(count)
0