結果

問題 No.1617 Palindrome Removal
ユーザー hayatroidhayatroid
提出日時 2021-07-22 21:31:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 145 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 9,940 KB
最終ジャッジ日時 2023-09-24 15:52:29
合計ジャッジ時間 2,317 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,828 KB
testcase_01 AC 31 ms
9,928 KB
testcase_02 AC 30 ms
9,840 KB
testcase_03 AC 31 ms
9,724 KB
testcase_04 AC 30 ms
9,860 KB
testcase_05 AC 27 ms
9,452 KB
testcase_06 AC 20 ms
9,880 KB
testcase_07 AC 18 ms
9,184 KB
testcase_08 AC 16 ms
7,852 KB
testcase_09 AC 16 ms
7,720 KB
testcase_10 AC 31 ms
9,860 KB
testcase_11 AC 29 ms
9,616 KB
testcase_12 AC 33 ms
9,876 KB
testcase_13 AC 31 ms
9,940 KB
testcase_14 AC 15 ms
7,768 KB
testcase_15 AC 15 ms
7,768 KB
testcase_16 AC 15 ms
7,780 KB
testcase_17 AC 15 ms
7,768 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 15 ms
7,812 KB
testcase_21 AC 14 ms
7,776 KB
testcase_22 AC 14 ms
7,788 KB
testcase_23 AC 15 ms
7,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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