結果

問題 No.1617 Palindrome Removal
ユーザー sasa8uyauya
提出日時 2024-06-30 17:15:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 118 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 102,712 KB
最終ジャッジ日時 2024-06-30 17:15:44
合計ジャッジ時間 3,221 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
n=len(s)
if s!=s[::-1]:
	print(n)
elif len(set(list(s)))==1:
	print([0,-1][n%2])
else:
	print([-1,n-2][n>3])
0