結果
| 問題 | No.588 空白と回文 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-13 13:45:31 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 46 ms / 2,000 ms |
| + 409µs | |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 77 ms |
| コンパイル使用メモリ | 64,752 KB |
| 実行使用メモリ | 58,896 KB |
| 最終ジャッジ日時 | 2026-10-15 06:17:23 |
| 合計ジャッジ時間 | 2,586 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
S = input()
N = len(S)
ans = 0
for i in range(N):
center1 = i
cnt = -1
for j in range(center1+1):
if 2*center1-j >= N:
continue
if S[j] == S[2*center1-j]:
cnt += 2
ans = max(ans,cnt)
center2 = i
cnt = 0
for j in range(center1+1):
if 2*center1-j+1 >= N:
continue
if S[j] == S[2*center1-j+1]:
cnt += 2
ans = max(ans,cnt)
print(ans)