結果

問題 No.1617 Palindrome Removal
ユーザー hir355
提出日時 2021-07-22 21:26:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 181 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 96,372 KB
最終ジャッジ日時 2024-07-17 16:18:46
合計ジャッジ時間 3,058 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 15 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
if set(s) == 1:
    if len(s) % 2 == 1:
        print(-1)
    else:
        print(0)
else:
    if s != s[::-1]:
        print(len(s))
    else:
        print(len(s) - 2)
0