結果
| 問題 | No.204 ゴールデン・ウィーク(2) |
| コンテスト | |
| ユーザー |
nari11111
|
| 提出日時 | 2015-05-08 23:29:34 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 81,024 KB |
| 実行使用メモリ | 81,408 KB |
| 最終ジャッジ日時 | 2026-07-17 14:33:44 |
| 合計ジャッジ時間 | 5,192 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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