結果

問題 No.588 空白と回文
ユーザー kappybar
提出日時 2020-05-06 15:30:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-28 16:38:45
合計ジャッジ時間 3,077 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input();n=len(s);ans=0
for i in range(n):
    c=1;j=1
    while 0<=i-j and i+j<n:
        if s[i-j]==s[i+j]:
            c+=2
        j+=1
    ans=max(ans,c)
for i in range(n-1):
    if s[i]!=s[i+1]:continue
    c=2;j=1
    while 0<=i-j and i+1+j<n:
        if s[i-j]==s[i+1+j]:
            c+=2
        j+=1
    ans=max(ans,c)
print(ans)
0