結果
| 問題 |
No.204 ゴールデン・ウィーク(2)
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-01-09 22:59:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 632 bytes |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 82,540 KB |
| 実行使用メモリ | 54,380 KB |
| 最終ジャッジ日時 | 2024-12-18 00:26:41 |
| 合計ジャッジ時間 | 3,425 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 25 |
ソースコード
def calc(S):
cnt = 0
N = len(S)
ans = 0
for i in range(N):
if S[i] == "o":
cnt += 1
else:
ans = max(ans, cnt)
cnt = 0
return max(ans, cnt)
D = int(input())
C = []
C.extend(list(input()))
C.extend(list(input()))
N = len(C)
ans = calc(C)
for d in range(1, D + 1):
for i in range(N - d):
if C[i:i+d] == ["x"] * d:
temp = [None] * N
for j in range(N):
if i <= j < i + d:
temp[j] = "o"
else:
temp[j] = C[j]
ans = max(ans, calc(temp))
print(ans)
rlangevin