結果
| 問題 |
No.491 10^9+1と回文
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-01 20:22:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 341 bytes |
| コンパイル時間 | 72 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-07 18:59:36 |
| 合計ジャッジ時間 | 5,251 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 58 WA * 45 |
ソースコード
#!/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 = str(top)[::-1][-keta:]
count += ue - 10 ** (keta - 1) + 1
if int(str(ue)[::-1]) > int(sita):
count -= 1
print(count)