結果

問題 No.1617 Palindrome Removal
ユーザー pluto77pluto77
提出日時 2021-08-06 15:48:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 173 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 12,476 KB
最終ジャッジ日時 2023-10-17 01:55:21
合計ジャッジ時間 3,990 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
12,364 KB
testcase_01 AC 42 ms
11,792 KB
testcase_02 AC 44 ms
11,572 KB
testcase_03 AC 45 ms
12,476 KB
testcase_04 AC 49 ms
11,792 KB
testcase_05 AC 42 ms
12,100 KB
testcase_06 AC 52 ms
11,792 KB
testcase_07 AC 41 ms
11,068 KB
testcase_08 AC 27 ms
9,852 KB
testcase_09 AC 27 ms
9,852 KB
testcase_10 AC 44 ms
12,448 KB
testcase_11 AC 47 ms
11,408 KB
testcase_12 AC 51 ms
11,792 KB
testcase_13 AC 49 ms
11,792 KB
testcase_14 AC 27 ms
9,852 KB
testcase_15 AC 27 ms
9,852 KB
testcase_16 AC 27 ms
9,852 KB
testcase_17 AC 27 ms
9,852 KB
testcase_18 AC 27 ms
9,852 KB
testcase_19 AC 28 ms
9,852 KB
testcase_20 AC 29 ms
9,852 KB
testcase_21 AC 28 ms
9,852 KB
testcase_22 AC 28 ms
9,852 KB
testcase_23 AC 27 ms
9,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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