結果

問題 No.1617 Palindrome Removal
ユーザー 👑 H20H20
提出日時 2021-07-22 23:08:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 192 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 79,904 KB
最終ジャッジ日時 2023-09-24 19:04:57
合計ジャッジ時間 4,124 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
79,624 KB
testcase_01 AC 101 ms
79,904 KB
testcase_02 AC 94 ms
79,628 KB
testcase_03 AC 95 ms
79,364 KB
testcase_04 AC 85 ms
75,248 KB
testcase_05 AC 81 ms
74,208 KB
testcase_06 AC 83 ms
75,108 KB
testcase_07 AC 80 ms
73,656 KB
testcase_08 AC 71 ms
71,384 KB
testcase_09 AC 71 ms
71,144 KB
testcase_10 AC 87 ms
74,760 KB
testcase_11 AC 84 ms
74,456 KB
testcase_12 AC 88 ms
75,160 KB
testcase_13 AC 87 ms
75,120 KB
testcase_14 AC 73 ms
71,440 KB
testcase_15 AC 73 ms
71,304 KB
testcase_16 AC 72 ms
71,348 KB
testcase_17 AC 72 ms
71,288 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 73 ms
71,560 KB
testcase_21 AC 73 ms
71,248 KB
testcase_22 AC 74 ms
71,156 KB
testcase_23 AC 73 ms
71,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
if S!=S[::-1]:
    print(len(S))
    exit()

for i in range(len(S)-1):
    if S[i]!=S[i+1]:
        print(len(S)-2)
        exit()
if len(S)%2==1:
    print(-1)
else:
    print(0)
0