結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー rlangevinrlangevin
提出日時 2023-01-09 23:01:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 661 bytes
コンパイル時間 1,838 ms
コンパイル使用メモリ 86,588 KB
実行使用メモリ 76,588 KB
最終ジャッジ日時 2023-08-22 22:02:39
合計ジャッジ時間 6,856 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
75,980 KB
testcase_01 AC 90 ms
75,692 KB
testcase_02 AC 87 ms
75,944 KB
testcase_03 AC 83 ms
76,032 KB
testcase_04 AC 79 ms
75,916 KB
testcase_05 AC 83 ms
75,956 KB
testcase_06 AC 79 ms
76,032 KB
testcase_07 AC 88 ms
76,120 KB
testcase_08 AC 97 ms
76,588 KB
testcase_09 AC 90 ms
75,932 KB
testcase_10 AC 89 ms
75,980 KB
testcase_11 AC 86 ms
76,028 KB
testcase_12 AC 86 ms
75,932 KB
testcase_13 AC 86 ms
75,956 KB
testcase_14 AC 83 ms
76,024 KB
testcase_15 AC 86 ms
75,776 KB
testcase_16 AC 84 ms
75,860 KB
testcase_17 AC 85 ms
76,044 KB
testcase_18 AC 88 ms
76,132 KB
testcase_19 AC 90 ms
75,728 KB
testcase_20 AC 90 ms
76,160 KB
testcase_21 AC 87 ms
75,928 KB
testcase_22 WA -
testcase_23 AC 88 ms
75,976 KB
testcase_24 AC 86 ms
75,856 KB
testcase_25 AC 86 ms
76,052 KB
testcase_26 AC 83 ms
76,000 KB
testcase_27 AC 87 ms
76,036 KB
testcase_28 AC 89 ms
75,980 KB
testcase_29 AC 82 ms
76,000 KB
testcase_30 AC 79 ms
75,892 KB
testcase_31 AC 84 ms
75,816 KB
testcase_32 AC 79 ms
75,884 KB
testcase_33 AC 88 ms
76,132 KB
testcase_34 AC 82 ms
76,020 KB
testcase_35 AC 76 ms
71,276 KB
testcase_36 AC 75 ms
71,068 KB
testcase_37 AC 83 ms
75,908 KB
testcase_38 AC 88 ms
75,916 KB
testcase_39 AC 82 ms
75,964 KB
testcase_40 AC 74 ms
71,104 KB
testcase_41 AC 82 ms
75,976 KB
testcase_42 AC 90 ms
76,056 KB
testcase_43 AC 75 ms
71,312 KB
testcase_44 AC 75 ms
71,152 KB
testcase_45 AC 87 ms
75,920 KB
testcase_46 AC 91 ms
75,988 KB
testcase_47 AC 93 ms
76,040 KB
testcase_48 AC 83 ms
75,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(S):
    cnt = 0
    N = len(S)
    ans = 0
    for i in range(N):
        if S[i] == "o":
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
    return max(ans, cnt)

D = int(input())
C = ["x"] * 14
C.extend(list(input()))
C.extend(list(input()))
C.extend(["x"] * 14)
N = len(C)
ans = calc(C)
for d in range(1, D + 1):
    for i in range(N - d):
        if C[i:i+d] == ["x"] * d:
            temp = [None] * N
            for j in range(N):
                if i <= j < i + d:
                    temp[j] = "o"
                else:
                    temp[j] = C[j]
            ans = max(ans, calc(temp))
print(ans)
0