結果
問題 |
No.204 ゴールデン・ウィーク(2)
|
ユーザー |
![]() |
提出日時 | 2016-05-31 05:59:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-13 14:02:49 |
合計ジャッジ時間 | 3,006 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 21 |
ソースコード
import re d = int(input()) W1 = input() W2 = input() GW = W1 + W2 pat = re.compile('o+') ans = [0] for i in range(14-d): if 'o' not in GW[i:i+d]: s = GW[:i] + 'o'*d + GW[i+d:] match = pat.findall(s) if match: ans.append(max([len(x) for x in match])) p_gw = 'o'*d + GW p = pat.findall(p_gw) if p: ans.append(max([len(y) for y in p])) a_gw = GW + 'o'*d a = pat.findall(a_gw) if a: ans.append(max([len(z) for z in a])) print(max(ans))