結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
rocoder
|
| 提出日時 | 2017-07-16 05:46:57 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 828 bytes |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-08 03:26:29 |
| 合計ジャッジ時間 | 3,056 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 RE * 19 |
ソースコード
#golden week
D=int(input())
C1=input()
C2=input()
C=C1+C2
i=0
Cn=[D]
while i <len(C) and C[i]=="x":
co+=1
i+=1
Cn[0]+= co
while i<len(C):
co=0
while i <len(C) and C[i]=="o":
co+=1
i+=1
Cn.append (co)
co=0
while i <len(C) and C[i]=="x":
co+=1
i+=1
Cn.append (co)
Cn[-1]+=D
m=0
j=0
#print (Cn)
while j<len(Cn):
V=D
i=j
# print (i)
g=0
while i<len(Cn) and V>=0:
if i%2==1:
g+=Cn[i]
# print (g)
elif V>=Cn[i]:
g+=Cn[i]
V=0
elif V>0:
if g==0:
g+=V
V=0
else:
g+=V
V=-1
else:
V=-1
i+=1
# print (g)
# print (g)
if g>m:
m=g
j+=1
print(m)
rocoder