結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー rlangevinrlangevin
提出日時 2023-01-09 23:03:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 1,000 ms
コード長 657 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 76,784 KB
最終ジャッジ日時 2023-08-22 22:04:06
合計ジャッジ時間 6,638 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
76,032 KB
testcase_01 AC 97 ms
76,784 KB
testcase_02 AC 88 ms
76,048 KB
testcase_03 AC 86 ms
76,104 KB
testcase_04 AC 84 ms
75,920 KB
testcase_05 AC 88 ms
75,928 KB
testcase_06 AC 82 ms
76,000 KB
testcase_07 AC 94 ms
76,008 KB
testcase_08 AC 96 ms
76,604 KB
testcase_09 AC 93 ms
75,816 KB
testcase_10 AC 92 ms
76,116 KB
testcase_11 AC 91 ms
76,064 KB
testcase_12 AC 87 ms
76,032 KB
testcase_13 AC 89 ms
75,816 KB
testcase_14 AC 89 ms
76,096 KB
testcase_15 AC 93 ms
76,136 KB
testcase_16 AC 89 ms
76,000 KB
testcase_17 AC 89 ms
76,184 KB
testcase_18 AC 91 ms
76,164 KB
testcase_19 AC 91 ms
75,940 KB
testcase_20 AC 92 ms
76,136 KB
testcase_21 AC 91 ms
76,136 KB
testcase_22 AC 90 ms
76,004 KB
testcase_23 AC 89 ms
75,952 KB
testcase_24 AC 91 ms
76,116 KB
testcase_25 AC 88 ms
76,068 KB
testcase_26 AC 86 ms
76,040 KB
testcase_27 AC 89 ms
76,000 KB
testcase_28 AC 92 ms
75,820 KB
testcase_29 AC 84 ms
75,892 KB
testcase_30 AC 79 ms
76,088 KB
testcase_31 AC 86 ms
76,012 KB
testcase_32 AC 86 ms
76,080 KB
testcase_33 AC 95 ms
76,160 KB
testcase_34 AC 83 ms
76,128 KB
testcase_35 AC 78 ms
71,264 KB
testcase_36 AC 76 ms
71,108 KB
testcase_37 AC 84 ms
76,036 KB
testcase_38 AC 89 ms
76,096 KB
testcase_39 AC 84 ms
75,880 KB
testcase_40 AC 76 ms
71,220 KB
testcase_41 AC 84 ms
75,964 KB
testcase_42 AC 90 ms
76,060 KB
testcase_43 AC 77 ms
71,456 KB
testcase_44 AC 76 ms
70,948 KB
testcase_45 AC 90 ms
76,008 KB
testcase_46 AC 91 ms
75,996 KB
testcase_47 AC 90 ms
76,100 KB
testcase_48 AC 84 ms
75,984 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):
        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