結果

問題 No.1617 Palindrome Removal
ユーザー ProgrammerryokiProgrammerryoki
提出日時 2021-07-22 21:39:15
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 173 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,492 KB
実行使用メモリ 10,024 KB
最終ジャッジ日時 2023-09-24 16:06:30
合計ジャッジ時間 1,832 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,760 KB
testcase_01 AC 31 ms
10,012 KB
testcase_02 AC 31 ms
9,748 KB
testcase_03 AC 31 ms
9,752 KB
testcase_04 AC 31 ms
10,024 KB
testcase_05 AC 28 ms
9,480 KB
testcase_06 AC 32 ms
9,860 KB
testcase_07 AC 26 ms
9,124 KB
testcase_08 AC 15 ms
7,796 KB
testcase_09 AC 15 ms
7,776 KB
testcase_10 AC 31 ms
9,856 KB
testcase_11 AC 29 ms
9,656 KB
testcase_12 AC 32 ms
9,940 KB
testcase_13 AC 34 ms
9,924 KB
testcase_14 AC 15 ms
7,924 KB
testcase_15 AC 15 ms
7,864 KB
testcase_16 AC 16 ms
7,780 KB
testcase_17 AC 16 ms
8,020 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 15 ms
7,836 KB
testcase_21 AC 16 ms
7,956 KB
testcase_22 AC 16 ms
7,804 KB
testcase_23 AC 16 ms
7,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
if len(S) == 1:
    print(-1)
    exit()
elif len(set(S)) == 1:
    print(-1 if len(S) & 1 else 0)
elif S != S[::-1]:
    print(len(S))
else:
    print(len(S)-2)
0