結果

問題 No.1617 Palindrome Removal
ユーザー hir355hir355
提出日時 2021-07-22 21:26:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 181 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 95,468 KB
最終ジャッジ日時 2023-09-24 15:32:32
合計ジャッジ時間 4,073 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 124 ms
95,164 KB
testcase_03 AC 123 ms
95,052 KB
testcase_04 AC 126 ms
95,456 KB
testcase_05 AC 120 ms
94,036 KB
testcase_06 AC 135 ms
95,328 KB
testcase_07 AC 119 ms
92,624 KB
testcase_08 AC 74 ms
71,148 KB
testcase_09 AC 73 ms
71,344 KB
testcase_10 AC 129 ms
95,056 KB
testcase_11 AC 126 ms
94,008 KB
testcase_12 AC 133 ms
95,452 KB
testcase_13 AC 135 ms
95,316 KB
testcase_14 AC 74 ms
71,236 KB
testcase_15 AC 73 ms
71,288 KB
testcase_16 WA -
testcase_17 AC 73 ms
70,996 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 74 ms
71,332 KB
testcase_21 AC 74 ms
71,412 KB
testcase_22 WA -
testcase_23 AC 74 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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