結果
| 問題 | No.1617 Palindrome Removal |
| コンテスト | |
| ユーザー |
SidewaysOwl
|
| 提出日時 | 2021-07-22 21:46:14 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 173 ms / 2,000 ms |
| + 617µs | |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 242 ms |
| コンパイル使用メモリ | 95,596 KB |
| 実行使用メモリ | 139,572 KB |
| 最終ジャッジ日時 | 2026-08-15 18:36:19 |
| 合計ジャッジ時間 | 5,169 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
from collections import Counter
s = list(input())
c = Counter(s)
if len(c) == 1:
if len(s) & 1:
print(-1)
else:
print(0)
elif s != s[::-1]:
print(len(s))
else:
if len(s) == 3:
print(-1)
else:
print(len(s)-2)
SidewaysOwl