結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
nari11111
|
| 提出日時 | 2015-05-09 00:11:24 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 468 bytes |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 6,948 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 11:59:03 |
| 合計ジャッジ時間 | 2,078 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 30 RE * 11 |
ソースコード
n = int(raw_input())
w = raw_input()+raw_input()
sall=[]
ball=[]
s = 0
b = 0
for e in w:
if e=='o':
if b>0:
ball.append(b)
b=0
s+=1
else:
if s>0:
sall.append(s)
s=0
b+=1
sall.append(s)
ball.append(b)
all=[]
for i in xrange(len(sall)-1):
all.append(sall[i]+sall[i+1])
anss=[]
for i,e in enumerate(ball):
if e<=n and i<len(all):
anss.append(e+all[i])
print max(anss)
nari11111