結果

問題 No.204 ゴールデン・ウィーク(2)
ユーザー nebukuro09
提出日時 2016-09-05 13:51:32
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 298 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-15 20:26:56
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38 WA * 6 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

D = input()
s = raw_input()+raw_input()
o = map(len, filter(None, s.split('x')))
x = map(len, filter(None, s.split('o')))
if s.startswith('x'):
    x.pop(0)
if s.endswith('x'):
    x.pop()
ans = max(o)+D
for i in xrange(len(x)):
    if x[i] <= D:
        ans = max(ans, o[i]+x[i]+o[i+1])
print ans
0