結果
| 問題 | No.1617 Palindrome Removal |
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 15:44:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 295 bytes |
| 記録 | |
| コンパイル時間 | 236 ms |
| コンパイル使用メモリ | 96,116 KB |
| 実行使用メモリ | 86,528 KB |
| 最終ジャッジ日時 | 2026-07-11 15:06:23 |
| 合計ジャッジ時間 | 3,720 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 WA * 2 |
ソースコード
def is_palindrome(s):
return s == s[::-1]
S = input().strip()
if not is_palindrome(S):
print(len(S))
else:
all_same = all(c == S[0] for c in S)
if all_same:
if len(S) % 2 == 0:
print(0)
else:
print(-1)
else:
print(len(S) - 2)
gew1fw