結果

問題 No.491 10^9+1と回文
ユーザー maatanbeta
提出日時 2017-05-08 10:56:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 207 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-14 17:13:13
合計ジャッジ時間 6,187 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
result = 0
n = N // (10**9+1)
result += (len(str(n)) - 1) * 9
H = str(n)[0] * len(str(n))
if n >= int(H):
    result += int(str(n)[0])
else:
    result += int(str(n)[0]) - 1

print(result)
0