結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー trineutron
提出日時 2021-02-23 22:13:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 564 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-22 16:30:14
合計ジャッジ時間 2,947 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
c = input() + input()
ans = d
for i in range(14):
    if c[i] == 'x':
        break
    ans = max(ans, d + i + 1)
for i in range(14):
    if c[13 - i] == 'x':
        break
    ans = max(ans, d + i + 1)
for i in range(14):
    longest = 0
    current = 0
    fst = True
    for j in range(14):
        if (i <= j < i + d and fst) or c[j] == 'o':
            current += 1
        else:
            current = 0
        longest = max(longest, current)
        if i <= j and c[j] == 'o':
            fst = False
    ans = max(ans, longest)
print(ans)
0