結果

問題 No.1617 Palindrome Removal
ユーザー trineutrontrineutron
提出日時 2021-07-22 21:27:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 225 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 10,564 KB
最終ジャッジ日時 2023-09-24 15:33:45
合計ジャッジ時間 5,326 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 366 ms
10,564 KB
testcase_01 AC 419 ms
9,964 KB
testcase_02 AC 299 ms
9,668 KB
testcase_03 AC 330 ms
9,792 KB
testcase_04 AC 252 ms
9,924 KB
testcase_05 AC 226 ms
9,568 KB
testcase_06 AC 19 ms
9,896 KB
testcase_07 AC 17 ms
9,140 KB
testcase_08 AC 15 ms
8,088 KB
testcase_09 AC 15 ms
7,944 KB
testcase_10 AC 251 ms
10,504 KB
testcase_11 AC 228 ms
9,692 KB
testcase_12 AC 240 ms
9,900 KB
testcase_13 AC 279 ms
9,924 KB
testcase_14 AC 16 ms
8,016 KB
testcase_15 AC 16 ms
8,020 KB
testcase_16 AC 15 ms
7,784 KB
testcase_17 AC 16 ms
7,856 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 15 ms
8,008 KB
testcase_21 AC 16 ms
7,948 KB
testcase_22 AC 16 ms
7,856 KB
testcase_23 AC 15 ms
8,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
n = len(s)

for i in range(n):
    if s[i] != s[n - i - 1]:
        print(n)
        exit()

for i in range(n):
    if s[i] != s[0]:
        print(n - 2)
        exit()

if n % 2:
    print(-1)
else:
    print(0)
0