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