結果

問題 No.1617 Palindrome Removal
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-20 19:49:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 163 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 9,944 KB
最終ジャッジ日時 2023-09-15 15:41:51
合計ジャッジ時間 1,846 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,880 KB
testcase_01 AC 31 ms
9,944 KB
testcase_02 AC 31 ms
9,904 KB
testcase_03 AC 31 ms
9,848 KB
testcase_04 AC 31 ms
9,828 KB
testcase_05 AC 30 ms
9,460 KB
testcase_06 AC 20 ms
9,936 KB
testcase_07 AC 18 ms
9,212 KB
testcase_08 AC 16 ms
8,052 KB
testcase_09 AC 16 ms
8,084 KB
testcase_10 AC 32 ms
9,772 KB
testcase_11 AC 30 ms
9,724 KB
testcase_12 AC 34 ms
9,916 KB
testcase_13 AC 33 ms
9,904 KB
testcase_14 AC 16 ms
7,976 KB
testcase_15 AC 15 ms
8,020 KB
testcase_16 AC 16 ms
7,780 KB
testcase_17 AC 15 ms
7,828 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 15 ms
8,084 KB
testcase_21 AC 15 ms
8,028 KB
testcase_22 AC 16 ms
7,856 KB
testcase_23 AC 15 ms
7,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)

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

if len(set(S)) != 1:
    print(N - 2)
    exit()

if N % 2 == 0:
    print(0)
else:
    print(-1)
0