結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-06-18 01:53:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 469 bytes |
| コンパイル時間 | 317 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-09 12:31:39 |
| 合計ジャッジ時間 | 2,929 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 11 |
ソースコード
D=int(input())
C=input().strip()+input().strip()
X=[['o', 0],["x",100]]
for c in C:
if X[-1][0]==c:
X[-1][1]+=1
else:
X.append([c,1])
X.append(["x",100])
X.append(['o', 0])
ANS=0
for i in range(len(X)-2):
if X[i][0]=="o" and X[i+2][0]=="o":
k=X[i+1][1]
if k<=D:
ANS=max(ANS,k+X[i][1]+X[i+2][1])
else:
ANS=max(ANS,D+X[i][1])
ANS=max(ANS,D+X[i+2][1])
print(ANS)
titia