結果

問題 No.1617 Palindrome Removal
ユーザー KudeKude
提出日時 2021-07-22 21:26:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 117 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 96,048 KB
最終ジャッジ日時 2023-09-24 15:31:19
合計ジャッジ時間 3,874 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
95,560 KB
testcase_01 AC 124 ms
95,868 KB
testcase_02 AC 122 ms
95,548 KB
testcase_03 AC 124 ms
95,284 KB
testcase_04 AC 125 ms
96,008 KB
testcase_05 AC 116 ms
94,124 KB
testcase_06 AC 84 ms
74,968 KB
testcase_07 AC 80 ms
73,500 KB
testcase_08 AC 73 ms
71,280 KB
testcase_09 AC 73 ms
71,248 KB
testcase_10 AC 128 ms
95,424 KB
testcase_11 AC 127 ms
94,404 KB
testcase_12 AC 129 ms
95,816 KB
testcase_13 AC 130 ms
96,048 KB
testcase_14 AC 72 ms
71,116 KB
testcase_15 AC 71 ms
71,372 KB
testcase_16 AC 72 ms
71,420 KB
testcase_17 AC 73 ms
71,356 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 71 ms
71,424 KB
testcase_21 AC 72 ms
71,280 KB
testcase_22 AC 72 ms
71,064 KB
testcase_23 AC 71 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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