結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-08 19:06:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 708 bytes |
| コンパイル時間 | 435 ms |
| コンパイル使用メモリ | 82,108 KB |
| 実行使用メモリ | 54,316 KB |
| 最終ジャッジ日時 | 2024-12-31 08:26:16 |
| 合計ジャッジ時間 | 3,653 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 6 |
ソースコード
D = int(input())
C1 = input()
C2 = input()
days = 'x'*D+C1+C2+'x'*D
ans = 0
for d in range(D+1):
for i in range(len(days)-d+1):
if days[i:i+D]!='x'*d:
continue
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)