結果
問題 | No.1617 Palindrome Removal |
ユーザー | Kude |
提出日時 | 2021-07-22 21:27:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 108 ms / 2,000 ms |
コード長 | 128 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 82,040 KB |
実行使用メモリ | 96,828 KB |
最終ジャッジ日時 | 2024-07-17 16:22:46 |
合計ジャッジ時間 | 2,863 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
s = input() n = len(s) ans = n if s != s[::-1] else n - 2 if len(set(s)) >= 2 and n >= 4 else 0 if n % 2 == 0 else -1 print(ans)