結果

問題 No.1617 Palindrome Removal
ユーザー O2MTO2MT
提出日時 2021-07-23 17:09:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 1,760 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 127,984 KB
最終ジャッジ日時 2023-09-25 15:30:05
合計ジャッジ時間 7,227 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 196 ms
125,996 KB
testcase_02 AC 198 ms
125,244 KB
testcase_03 AC 189 ms
124,960 KB
testcase_04 AC 196 ms
127,484 KB
testcase_05 AC 174 ms
117,300 KB
testcase_06 AC 206 ms
127,576 KB
testcase_07 AC 166 ms
106,820 KB
testcase_08 AC 94 ms
71,564 KB
testcase_09 AC 95 ms
71,752 KB
testcase_10 AC 198 ms
124,008 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 94 ms
71,824 KB
testcase_15 AC 94 ms
71,544 KB
testcase_16 AC 94 ms
71,392 KB
testcase_17 AC 92 ms
71,532 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 97 ms
71,748 KB
testcase_21 AC 94 ms
71,672 KB
testcase_22 WA -
testcase_23 AC 93 ms
71,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

S = str(input())
N = len(S)
if len(S) == 1:
  print(-1)
  exit()
ls = list(S)
cs = Counter(ls)
if len(cs) == 1:
  print(0)
else:
  if S[:N//2] != S[N-1:N//2:-1]:
    print(N)
  else:
    print(N-2)
0