結果
問題 |
No.588 空白と回文
|
ユーザー |
|
提出日時 | 2022-08-28 09:43:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 75,648 KB |
最終ジャッジ日時 | 2024-10-15 08:42:28 |
合計ジャッジ時間 | 2,216 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 9 |
ソースコード
S = input() n = len(S) ans = 1 for i in range(n): j = 1 res = 1 while i - j >= 0 and i + j < n: if S[i - j] == S[i + j]: res += 2 j += 1 ans = max(ans, res) for i in range(n - 1): j = 0 res = 0 while i - j >= 0 and i + j + 1 < n: if S[i - j] == S[i + j + 1]: res += 1 j += 1 ans = max(ans, res) print(ans)