結果

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

ソースコード

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