結果

問題 No.1617 Palindrome Removal
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-07-22 22:57:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 139 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 9,992 KB
最終ジャッジ日時 2023-09-24 18:43:36
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,716 KB
testcase_01 AC 31 ms
9,816 KB
testcase_02 AC 31 ms
9,740 KB
testcase_03 AC 30 ms
9,708 KB
testcase_04 AC 31 ms
9,816 KB
testcase_05 AC 30 ms
9,600 KB
testcase_06 AC 20 ms
9,860 KB
testcase_07 AC 18 ms
9,052 KB
testcase_08 AC 16 ms
7,808 KB
testcase_09 AC 16 ms
7,728 KB
testcase_10 AC 30 ms
9,804 KB
testcase_11 AC 28 ms
9,592 KB
testcase_12 AC 31 ms
9,992 KB
testcase_13 AC 33 ms
9,788 KB
testcase_14 AC 15 ms
7,760 KB
testcase_15 AC 16 ms
7,828 KB
testcase_16 AC 16 ms
7,840 KB
testcase_17 AC 16 ms
7,872 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 16 ms
7,808 KB
testcase_21 AC 15 ms
7,792 KB
testcase_22 AC 15 ms
7,936 KB
testcase_23 AC 15 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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