結果

問題 No.1617 Palindrome Removal
ユーザー hir355hir355
提出日時 2021-07-22 21:27:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 186 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 95,544 KB
最終ジャッジ日時 2023-09-24 15:34:31
合計ジャッジ時間 3,956 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
93,852 KB
testcase_01 AC 114 ms
93,876 KB
testcase_02 AC 122 ms
95,024 KB
testcase_03 AC 123 ms
95,072 KB
testcase_04 AC 125 ms
95,328 KB
testcase_05 AC 119 ms
93,800 KB
testcase_06 AC 132 ms
95,084 KB
testcase_07 AC 113 ms
92,500 KB
testcase_08 AC 71 ms
71,116 KB
testcase_09 AC 70 ms
71,272 KB
testcase_10 AC 127 ms
94,996 KB
testcase_11 AC 118 ms
93,860 KB
testcase_12 AC 127 ms
95,252 KB
testcase_13 AC 128 ms
95,544 KB
testcase_14 AC 71 ms
71,220 KB
testcase_15 AC 75 ms
70,916 KB
testcase_16 AC 72 ms
71,308 KB
testcase_17 AC 71 ms
71,140 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 69 ms
71,148 KB
testcase_21 AC 70 ms
71,356 KB
testcase_22 AC 69 ms
71,248 KB
testcase_23 AC 71 ms
70,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
if len(set(s)) == 1:
    if len(s) % 2 == 1:
        print(-1)
    else:
        print(0)
else:
    if s != s[::-1]:
        print(len(s))
    else:
        print(len(s) - 2)
0