結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー sugar_sentan
提出日時 2019-12-10 19:19:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-24 02:08:52
合計ジャッジ時間 2,884 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 10 RE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
# xが平日, oが休日
s = str(input())
s += str(input())
ans = 0

# xをoにしたら飛ばすようにする
for i in range(len(s)):
    cnt = i
    tmp = 0
    hoge = D
    while len(s) > cnt:
        if s[cnt] == "x":
            if hoge <= 0:
                break
            else:
                for _ in range(hoge):
                    if s[cnt] == "o":
                        break
                    cnt += 1
                    tmp += 1
                hoge = 0
        elif s[cnt] == "o":
            tmp += 1
            cnt += 1
    ans = max(ans, tmp)
print(min(ans, 14))
0