結果
| 問題 |
No.1617 Palindrome Removal
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-22 21:39:33 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 2,000 ms |
| コード長 | 177 bytes |
| コンパイル時間 | 106 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 13,384 KB |
| 最終ジャッジ日時 | 2024-07-17 16:53:36 |
| 合計ジャッジ時間 | 2,000 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
s = input().rstrip()
if s!=s[::-1]:
print(len(s))
elif len(s) == 3:
print(-1)
elif len(set(s))>1:
print(len(s)-2)
elif len(s)%2==0:
print(0)
else:
print(-1)