結果

問題 No.1617 Palindrome Removal
ユーザー minimumminimum
提出日時 2021-07-22 21:35:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 130,976 KB
最終ジャッジ日時 2024-07-17 16:45:02
合計ジャッジ時間 3,494 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

x = list(input())
y = list(reversed(x))

if x != y:
    print(len(x))
else:
    if x.count(x[0]) == len(x):
        print(- (len(x) % 2))
    elif len(x) == 3:
        print(-1)
    else:
        print(len(x) - 2)
0