結果

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

ソースコード

diff #

d = int(input())
c = input() + input()
ans = d
s = d
x = False
for i in range(14):
    if x and c[i] == 'x':
        break
    if c[i] == 'x':
        x = True
    else:
        s += 1
ans = max(ans, s)
s = d
x = False
for i in range(14):
    if c[13 - i] == 'x':
        break
    if c[i] == 'x':
        x = True
    else:
        s += 1
ans = max(ans, s)
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