結果
| 問題 |
No.1617 Palindrome Removal
|
| コンテスト | |
| ユーザー |
soraie_
|
| 提出日時 | 2021-07-23 13:09:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 169 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 13,528 KB |
| 最終ジャッジ日時 | 2024-07-18 09:12:20 |
| 合計ジャッジ時間 | 1,903 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
s=input()
if len(s)==1:
print(-1)
elif s[0:-2]==s[1:-1]:
print(-1 if len(s)&1 else 0)
elif s==s[::-1]:
print(len(s)-2 if len(s)!=3 else -1)
else:
print(len(s))
soraie_