結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
nehan_der_thal
|
| 提出日時 | 2020-03-26 19:17:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 280 bytes |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 82,840 KB |
| 実行使用メモリ | 54,368 KB |
| 最終ジャッジ日時 | 2025-01-02 02:59:10 |
| 合計ジャッジ時間 | 2,730 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 22 WA * 10 |
ソースコード
S = input().strip()
def check(s):
n = len(s)
for i in range(n):
if s[i] != s[n-i-1]:
return False
return True
r = 0
N = len(S)
for i in range(1, N):
if check(S[:i]):
r = max(r, i)
if check(S[i:]):
r = max(r, N-i)
print(r)
nehan_der_thal