結果

問題 No.491 10^9+1と回文
ユーザー yumechi
提出日時 2017-03-10 22:48:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 54,220 KB
最終ジャッジ日時 2024-06-24 08:26:22
合計ジャッジ時間 6,606 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    ans = 0
    num = 10 ** 9 + 1
    for i in range(len(str(n // (10 ** 9)))):
        for j in range(1, 10):
            if num * int(str(j) * (i + 1)) <= n:
                ans += 1
            else:
                break
    print(ans)

if __name__=="__main__":
    solve()
0