結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
zombietan
|
| 提出日時 | 2016-05-31 07:19:39 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 783 bytes |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-10-13 14:02:53 |
| 合計ジャッジ時間 | 2,936 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 31 WA * 15 |
ソースコード
import re
d = int(input())
W1 = input()
W2 = input()
GW = W1 + W2
pat = re.compile('o+')
pat2 = re.compile('x+')
ans = [0]
for i in range(14):
mob = pat2.search(GW, i)
if mob:
(j, k) = mob.span()
if k - j < d:
v = GW[:j] + 'o'*(k-j) + GW[k:]
matchv = pat.findall(v)
if matchv:
ans.append(max([len(q) for q in matchv]))
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))
zombietan