結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-08 19:03:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 554 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 82,668 KB |
| 実行使用メモリ | 61,208 KB |
| 最終ジャッジ日時 | 2024-12-31 08:15:13 |
| 合計ジャッジ時間 | 3,754 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 11 |
ソースコード
D = int(input())
C1 = input()
C2 = input()
days = 'x'*D+C1+C2+'x'*D
ans = 0
for i in range(len(days)-D+1):
days_ = ''
for j in range(len(days)):
if i<=j<i+D:
days_ += 'o'
else:
days_ += days[j]
r = 0
c = 0
for l in range(len(days_)):
while r<len(days_) and days_[r]=='o':
c += 1
r += 1
ans = max(ans, r-l)
if l==r:
r += 1
else:
if days_[l]=='o':
c -= 1
print(ans)