結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー 👑 rin204rin204
提出日時 2022-01-20 08:21:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 2,002 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 71,460 KB
最終ジャッジ日時 2023-08-15 08:30:27
合計ジャッジ時間 5,100 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,112 KB
testcase_01 AC 62 ms
71,124 KB
testcase_02 AC 63 ms
71,232 KB
testcase_03 AC 64 ms
71,308 KB
testcase_04 AC 63 ms
71,256 KB
testcase_05 AC 62 ms
71,116 KB
testcase_06 AC 65 ms
71,436 KB
testcase_07 AC 63 ms
71,132 KB
testcase_08 AC 64 ms
71,236 KB
testcase_09 AC 63 ms
71,144 KB
testcase_10 AC 61 ms
71,084 KB
testcase_11 AC 61 ms
71,332 KB
testcase_12 AC 63 ms
71,360 KB
testcase_13 AC 63 ms
71,120 KB
testcase_14 AC 61 ms
71,256 KB
testcase_15 AC 62 ms
71,128 KB
testcase_16 AC 65 ms
71,268 KB
testcase_17 AC 63 ms
71,144 KB
testcase_18 AC 63 ms
71,312 KB
testcase_19 AC 64 ms
71,328 KB
testcase_20 AC 68 ms
71,316 KB
testcase_21 AC 65 ms
71,084 KB
testcase_22 AC 63 ms
71,256 KB
testcase_23 AC 61 ms
70,936 KB
testcase_24 AC 63 ms
71,136 KB
testcase_25 AC 64 ms
71,120 KB
testcase_26 AC 63 ms
71,332 KB
testcase_27 AC 66 ms
71,308 KB
testcase_28 AC 65 ms
71,432 KB
testcase_29 AC 65 ms
71,364 KB
testcase_30 AC 67 ms
71,364 KB
testcase_31 WA -
testcase_32 AC 69 ms
71,176 KB
testcase_33 AC 68 ms
71,312 KB
testcase_34 AC 70 ms
71,316 KB
testcase_35 AC 69 ms
71,136 KB
testcase_36 WA -
testcase_37 AC 71 ms
71,148 KB
testcase_38 AC 70 ms
71,192 KB
testcase_39 AC 69 ms
71,236 KB
testcase_40 AC 70 ms
71,364 KB
testcase_41 AC 71 ms
71,328 KB
testcase_42 AC 68 ms
71,256 KB
testcase_43 AC 66 ms
70,932 KB
testcase_44 AC 66 ms
70,924 KB
testcase_45 AC 65 ms
70,932 KB
testcase_46 AC 65 ms
71,328 KB
testcase_47 AC 65 ms
70,928 KB
testcase_48 AC 63 ms
71,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
C = "o" + "x" * (d + 1) + input() + input() + "x" * (d + 1) + "o"

bef = "o"
lst = []
cnt = 0
for c in C:
    if c != bef:
        lst.append(cnt)
        cnt = 1
        bef = c
    else:
        cnt += 1

lst.append(cnt)


l = len(lst)
ans = 0
for i in range(1, l, 2):
    if lst[i] <= d:
        ans = max(ans, lst[i - 1] + lst[i] + lst[i + 1])
    else:
        ans = max(ans, max(lst[i - 1], lst[i + 1]) + d)
print(ans)
0