結果

問題 No.1617 Palindrome Removal
ユーザー SidewaysOwl
提出日時 2021-07-22 21:44:46
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 259 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 131,216 KB
最終ジャッジ日時 2024-07-17 17:05:15
合計ジャッジ時間 4,069 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
s = list(input())
c = Counter(s)
if len(c) == 1:
    if len(s) & 1:
        print(-1)
    else:
        print(0)
elif s != s[::-1]:
    print(len(s))
else:
    if len(s) == 3:
        ptint(-1)
    else:
        print(len(s)-2)
0