結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー flippergo
提出日時 2024-12-30 16:24:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 57,472 KB
最終ジャッジ日時 2024-12-30 16:24:33
合計ジャッジ時間 4,331 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
C = list(input())
C += list(input())
C = ["x"]*D + C +["x"]*D
ans = 0
if D==0:
    cnt = 0
    for j in range(14):
        if C[j]=="o":
            cnt += 1
        else:
            ans = max(ans,cnt)
            cnt = 0
else:
    for i in range(14+D+1):
        if C[i]=="x":
            A = C[:]
            cnt = 0
            while cnt<D and A[cnt+i]=="x":
                A[cnt+i] = "o"
                cnt += 1
            cnt = 0
            for j in range(14+2*D):
                if A[j]=="o":
                    cnt += 1
                else:
                    ans = max(ans,cnt)
                    cnt = 0
print(ans)
0