結果

問題 No.1617 Palindrome Removal
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-07-22 21:44:46
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 259 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 133,976 KB
最終ジャッジ日時 2023-09-24 16:18:31
合計ジャッジ時間 5,625 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 194 ms
123,464 KB
testcase_01 AC 196 ms
125,792 KB
testcase_02 AC 230 ms
131,296 KB
testcase_03 AC 231 ms
130,888 KB
testcase_04 AC 237 ms
133,976 KB
testcase_05 AC 209 ms
122,380 KB
testcase_06 AC 211 ms
133,608 KB
testcase_07 AC 170 ms
106,588 KB
testcase_08 AC 91 ms
71,276 KB
testcase_09 AC 91 ms
71,584 KB
testcase_10 AC 226 ms
129,888 KB
testcase_11 AC 211 ms
122,576 KB
testcase_12 AC 242 ms
133,760 KB
testcase_13 AC 235 ms
133,784 KB
testcase_14 AC 93 ms
71,652 KB
testcase_15 AC 92 ms
71,676 KB
testcase_16 AC 92 ms
71,440 KB
testcase_17 AC 93 ms
71,640 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 92 ms
71,640 KB
testcase_21 AC 90 ms
71,472 KB
testcase_22 AC 94 ms
71,548 KB
testcase_23 AC 92 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
s = list(input())
c = Counter(s)
if len(c) == 1:
    if len(s) & 1:
        print(-1)
    else:
        print(0)
elif s != s[::-1]:
    print(len(s))
else:
    if len(s) == 3:
        ptint(-1)
    else:
        print(len(s)-2)
0