結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー noko2250
提出日時 2015-06-07 00:02:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 551 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-13 13:20:47
合計ジャッジ時間 2,603 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
Created on 2015/06/06
'''

D = int(input())
date = "xxxxxxx" + input() + input() + "xxxxxxx"
def calc(day):
    ans, tmp = 0, 0
    for d in day:
        if d == 'o':
            tmp += 1
        else:
            ans = max(ans, tmp)
            tmp = 0
    return max(ans, tmp)

ans = calc(date)
for i in range(len(date)):
    d = date
    for x in range(i, len(date)):
        if x-i == D:
            break
        if date[x] == 'x':
            d = d[:x] + "o" + d[x+1:]
        else:
            break
    ans = max(ans, calc(d))

print(ans)
0