結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
nari11111
|
| 提出日時 | 2015-05-08 23:29:34 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 77,524 KB |
| 最終ジャッジ日時 | 2025-12-03 15:04:12 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 15 RE * 26 |
ソースコード
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 e!=0:
anss.append(e+all[i])
print max(anss)
nari11111