結果

問題 No.1617 Palindrome Removal
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-07-22 23:13:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 168 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 102,056 KB
最終ジャッジ日時 2023-09-24 19:15:15
合計ジャッジ時間 4,080 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
101,064 KB
testcase_01 AC 123 ms
101,572 KB
testcase_02 AC 122 ms
101,132 KB
testcase_03 AC 123 ms
101,272 KB
testcase_04 AC 126 ms
101,568 KB
testcase_05 AC 114 ms
99,156 KB
testcase_06 AC 82 ms
74,924 KB
testcase_07 AC 78 ms
73,396 KB
testcase_08 AC 72 ms
71,248 KB
testcase_09 AC 69 ms
71,340 KB
testcase_10 AC 130 ms
100,884 KB
testcase_11 AC 120 ms
99,188 KB
testcase_12 AC 133 ms
102,056 KB
testcase_13 AC 133 ms
101,564 KB
testcase_14 AC 68 ms
71,240 KB
testcase_15 AC 68 ms
71,324 KB
testcase_16 AC 69 ms
71,160 KB
testcase_17 AC 64 ms
71,456 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 65 ms
71,424 KB
testcase_21 AC 66 ms
71,196 KB
testcase_22 AC 70 ms
71,180 KB
testcase_23 AC 70 ms
71,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
n = len(S)
if S != S[::-1]:
    print(n)
    exit()
if len(set(list(S))) == 1:
    if n%2:
        print(-1)
    else:
        print(0)
else:
    print(n-2)
0