結果

問題 No.1617 Palindrome Removal
ユーザー mrngmrng
提出日時 2021-12-12 20:57:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 180 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 103,480 KB
最終ジャッジ日時 2023-09-28 14:20:27
合計ジャッジ時間 4,465 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
100,880 KB
testcase_01 AC 127 ms
101,396 KB
testcase_02 AC 132 ms
102,672 KB
testcase_03 AC 135 ms
102,476 KB
testcase_04 AC 133 ms
103,156 KB
testcase_05 AC 129 ms
100,320 KB
testcase_06 AC 142 ms
103,480 KB
testcase_07 AC 120 ms
97,188 KB
testcase_08 AC 74 ms
71,168 KB
testcase_09 AC 73 ms
71,176 KB
testcase_10 AC 136 ms
102,280 KB
testcase_11 AC 134 ms
100,148 KB
testcase_12 AC 139 ms
103,348 KB
testcase_13 AC 138 ms
103,384 KB
testcase_14 AC 75 ms
71,332 KB
testcase_15 AC 75 ms
71,520 KB
testcase_16 AC 74 ms
71,172 KB
testcase_17 AC 76 ms
71,476 KB
testcase_18 AC 76 ms
70,992 KB
testcase_19 AC 77 ms
71,116 KB
testcase_20 AC 75 ms
71,124 KB
testcase_21 AC 76 ms
71,416 KB
testcase_22 AC 75 ms
71,168 KB
testcase_23 AC 74 ms
71,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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