結果

問題 No.1617 Palindrome Removal
ユーザー minimumminimum
提出日時 2021-07-22 21:35:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 131,876 KB
最終ジャッジ日時 2023-09-24 15:59:35
合計ジャッジ時間 4,432 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 172 ms
128,868 KB
testcase_01 AC 182 ms
131,488 KB
testcase_02 AC 175 ms
129,368 KB
testcase_03 AC 177 ms
128,560 KB
testcase_04 AC 186 ms
131,488 KB
testcase_05 AC 162 ms
120,488 KB
testcase_06 AC 120 ms
112,968 KB
testcase_07 AC 114 ms
104,904 KB
testcase_08 AC 72 ms
71,396 KB
testcase_09 AC 70 ms
71,304 KB
testcase_10 AC 169 ms
128,016 KB
testcase_11 AC 157 ms
120,900 KB
testcase_12 AC 181 ms
131,808 KB
testcase_13 AC 178 ms
131,876 KB
testcase_14 AC 71 ms
71,048 KB
testcase_15 AC 72 ms
71,280 KB
testcase_16 AC 73 ms
71,240 KB
testcase_17 AC 72 ms
71,332 KB
testcase_18 AC 72 ms
71,252 KB
testcase_19 AC 72 ms
71,116 KB
testcase_20 AC 73 ms
71,316 KB
testcase_21 AC 71 ms
71,396 KB
testcase_22 AC 71 ms
71,404 KB
testcase_23 AC 70 ms
71,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = list(input())
y = list(reversed(x))

if x != y:
    print(len(x))
else:
    if x.count(x[0]) == len(x):
        print(- (len(x) % 2))
    elif len(x) == 3:
        print(-1)
    else:
        print(len(x) - 2)
0