結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー cormoran
提出日時 2016-08-16 21:32:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 1,000 ms
コード長 395 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-24 11:56:21
合計ジャッジ時間 3,079 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import copy

n = int(input())
days = 'x' * 20 + input() + input() + 'x' * 20

ans = 0

for i in range(len(days)):
    day2 = list(copy.copy(days))
    for j in range(n):
        if i + j < len(day2):
            if day2[i + j] == 'o':
                break
            day2[i + j] = 'o'
    ans = max(ans, max(map(lambda x: len(x), "".join(day2).split('x'))))

print(ans)
0