結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー mkawa2mkawa2
提出日時 2020-01-03 12:08:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,191 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 30,240 KB
最終ジャッジ日時 2023-08-14 19:08:50
合計ジャッジ時間 9,675 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 134 ms
29,968 KB
testcase_02 WA -
testcase_03 AC 135 ms
30,024 KB
testcase_04 AC 136 ms
30,000 KB
testcase_05 AC 135 ms
30,024 KB
testcase_06 AC 135 ms
30,044 KB
testcase_07 AC 135 ms
30,084 KB
testcase_08 AC 135 ms
29,832 KB
testcase_09 AC 135 ms
30,044 KB
testcase_10 AC 136 ms
30,044 KB
testcase_11 AC 136 ms
29,880 KB
testcase_12 AC 136 ms
29,956 KB
testcase_13 AC 136 ms
29,988 KB
testcase_14 AC 139 ms
29,928 KB
testcase_15 WA -
testcase_16 AC 134 ms
29,936 KB
testcase_17 AC 135 ms
30,044 KB
testcase_18 AC 135 ms
30,136 KB
testcase_19 AC 134 ms
30,004 KB
testcase_20 AC 137 ms
29,936 KB
testcase_21 AC 135 ms
30,084 KB
testcase_22 AC 135 ms
30,008 KB
testcase_23 AC 136 ms
29,996 KB
testcase_24 AC 135 ms
30,012 KB
testcase_25 WA -
testcase_26 AC 135 ms
30,028 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 136 ms
30,008 KB
testcase_30 AC 135 ms
29,784 KB
testcase_31 WA -
testcase_32 AC 134 ms
30,072 KB
testcase_33 AC 132 ms
29,984 KB
testcase_34 AC 135 ms
30,024 KB
testcase_35 AC 136 ms
29,956 KB
testcase_36 AC 133 ms
29,788 KB
testcase_37 AC 133 ms
30,000 KB
testcase_38 AC 132 ms
30,012 KB
testcase_39 AC 133 ms
29,936 KB
testcase_40 AC 129 ms
30,212 KB
testcase_41 AC 131 ms
30,000 KB
testcase_42 AC 130 ms
30,036 KB
testcase_43 AC 129 ms
30,016 KB
testcase_44 AC 130 ms
30,076 KB
testcase_45 AC 130 ms
29,996 KB
testcase_46 AC 132 ms
30,004 KB
testcase_47 AC 127 ms
30,228 KB
testcase_48 AC 132 ms
30,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
#from math import *
from collections import *
from heapq import *
from random import *
from decimal import *
import numpy as np
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(0, 1), (1, 0), (0, -1), (-1, 0)]

def main():
    d=II()
    s=input()+input()+"x"
    co=cx=0
    ans=0
    pco=0
    for c in s:
        if c=="o":
            co+=1
        else:
            if co>0:
                if cx<=d:
                    ans=max(ans,pco+cx+co)
                ans=max(ans,co+d)
                pco=co
                co=0
                cx=1
            else:
                cx+=1
    print(ans)

main()
0