結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー mkawa2mkawa2
提出日時 2020-01-03 12:24:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,300 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,320 KB
最終ジャッジ日時 2024-05-02 07:09:59
合計ジャッジ時間 30,110 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 544 ms
44,180 KB
testcase_01 AC 546 ms
44,056 KB
testcase_02 AC 545 ms
43,928 KB
testcase_03 AC 539 ms
44,064 KB
testcase_04 AC 547 ms
44,056 KB
testcase_05 AC 541 ms
44,056 KB
testcase_06 AC 547 ms
44,060 KB
testcase_07 AC 551 ms
44,060 KB
testcase_08 WA -
testcase_09 AC 550 ms
44,052 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 538 ms
44,188 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 541 ms
44,044 KB
testcase_19 WA -
testcase_20 AC 546 ms
44,184 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 541 ms
44,192 KB
testcase_26 AC 538 ms
43,932 KB
testcase_27 AC 541 ms
43,932 KB
testcase_28 AC 541 ms
44,056 KB
testcase_29 AC 542 ms
44,052 KB
testcase_30 AC 532 ms
44,180 KB
testcase_31 AC 545 ms
44,060 KB
testcase_32 AC 556 ms
44,180 KB
testcase_33 AC 536 ms
44,180 KB
testcase_34 AC 537 ms
44,056 KB
testcase_35 AC 541 ms
44,060 KB
testcase_36 AC 541 ms
44,052 KB
testcase_37 AC 539 ms
44,180 KB
testcase_38 AC 556 ms
43,928 KB
testcase_39 AC 543 ms
44,184 KB
testcase_40 AC 545 ms
44,188 KB
testcase_41 AC 535 ms
43,924 KB
testcase_42 AC 536 ms
44,060 KB
testcase_43 AC 541 ms
44,052 KB
testcase_44 AC 555 ms
44,048 KB
testcase_45 AC 541 ms
43,932 KB
testcase_46 AC 556 ms
44,060 KB
testcase_47 WA -
testcase_48 AC 577 ms
44,056 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 or pco == 0:
                    ans = max(ans, co + d)
                else:
                    ans = max(ans, pco + cx + co)
                pco = co
                co = 0
                cx = 1
            else:
                cx += 1
    ans = max(ans, co + d)
    print(ans)

main()
0