結果

問題 No.491 10^9+1と回文
ユーザー tsubametsubame
提出日時 2017-04-01 20:03:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 337 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-07 18:58:57
合計ジャッジ時間 4,639 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 94 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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 = top // 10 ** (k - keta)
sita = int(str(top)[::-1]) // 10 ** (k - keta)
count +=  ue - 10 ** (keta - 1) + 1
if ue > sita:
    count -= 1
print(count)
0