結果
問題 | No.491 10^9+1と回文 |
ユーザー |
|
提出日時 | 2017-04-01 20:24:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 1,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 231 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-01 08:40:54 |
合計ジャッジ時間 | 5,489 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 103 |
ソースコード
#!/usr/bin/pythonN = int(input())top = N // 1000000001count = 0k = len(str(top))for i in range(1, k):count += 9 * 10 ** ((i - 1) // 2)keta = (k + 1) // 2ue = str(top)[:keta]sita = str(top)[-keta:]count += int(ue) - 10 ** (keta - 1) + 1if int(ue[::-1]) > int(sita):count -= 1print(count)