結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー mai
提出日時 2017-05-22 06:41:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 58,112 KB
最終ジャッジ日時 2024-09-19 08:57:59
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

# pythonしょしんしゃ

d = int(input())
ll = "xxxxxxxxxxxxxxx" + input() + input() + "xxxxxxxxxxxxxxx"

result = d
for x in range(1,30):
    fail = False
    for i in range(x, x + d):
        if ll[i] == 'o':
            fail = True
            break
        # l[x] = 'o' # むり
    if fail:
        continue
    
    l = ll[:x]+('o'*d)+ll[x+d:]
    # print(l)
    
    nice = 0
    for c in l:
        if c == 'o':
            nice+=1
            result = max(result, nice)
        else:
            nice = 0

print(result)
0