結果

問題 No.1617 Palindrome Removal
ユーザー convexineqconvexineq
提出日時 2021-07-22 23:01:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 79,760 KB
最終ジャッジ日時 2023-09-24 18:50:44
合計ジャッジ時間 3,731 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
79,700 KB
testcase_01 AC 105 ms
79,760 KB
testcase_02 AC 99 ms
79,448 KB
testcase_03 AC 98 ms
79,600 KB
testcase_04 AC 92 ms
75,184 KB
testcase_05 AC 85 ms
74,264 KB
testcase_06 AC 87 ms
75,144 KB
testcase_07 AC 83 ms
73,688 KB
testcase_08 AC 76 ms
71,524 KB
testcase_09 AC 73 ms
71,524 KB
testcase_10 AC 83 ms
74,844 KB
testcase_11 AC 82 ms
74,244 KB
testcase_12 AC 86 ms
75,144 KB
testcase_13 AC 87 ms
74,916 KB
testcase_14 AC 75 ms
71,240 KB
testcase_15 AC 72 ms
71,556 KB
testcase_16 AC 71 ms
71,236 KB
testcase_17 AC 73 ms
71,260 KB
testcase_18 AC 72 ms
71,300 KB
testcase_19 AC 72 ms
71,388 KB
testcase_20 AC 73 ms
71,324 KB
testcase_21 AC 71 ms
71,368 KB
testcase_22 AC 75 ms
71,272 KB
testcase_23 AC 73 ms
71,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
ans = 0
if s != s[::-1]:
    ans = len(s)
elif any(si != s[0] for si in s):
    if len(s) == 3:
        ans = -1
    else:
        ans = len(s)-2
elif len(s)%2:
    ans = -1
print(ans)
0