結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 16:43:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 582 bytes |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 82,032 KB |
| 実行使用メモリ | 54,140 KB |
| 最終ジャッジ日時 | 2025-06-12 16:43:39 |
| 合計ジャッジ時間 | 3,667 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 6 |
ソースコード
D = int(input())
line1 = input().strip()
line2 = input().strip()
original = line1 + line2
extended = 'x' * D + original + 'x' * D
max_streak = 0
n = len(extended)
for i in range(n - D + 1):
substr = extended[i:i+D]
if substr.count('x') != D:
continue
new_str = extended[:i] + 'o' * D + extended[i+D:]
current = 0
max_current = 0
for c in new_str:
if c == 'o':
current += 1
max_current = max(max_current, current)
else:
current = 0
max_streak = max(max_streak, max_current)
print(max_streak)
gew1fw