Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

66-tgyuuAn #222

Merged
merged 2 commits into from
Aug 6, 2024
Merged

66-tgyuuAn #222

merged 2 commits into from
Aug 6, 2024

Conversation

tgyuuAn
Copy link
Member

@tgyuuAn tgyuuAn commented Jul 22, 2024

πŸ”— 문제 링크

λ‘œλ΄‡ μ‘°μ’…ν•˜κΈ°

βœ”οΈ μ†Œμš”λœ μ‹œκ°„

2μ‹œκ°„

ν’€λ‹€κ°€ ν™”λ‚Όλ»”

image

✨ μˆ˜λ„ μ½”λ“œ

image




λ‘œλ΄‡μ΄ 움직일 수 μžˆλŠ” λ°©ν–₯이 쒌, 우, μ•„λž˜ 밖에 μ—†λ‹€λŠ” μ μ—μ„œ λΆˆλ„κΈ° λ¬Έμ œμ™€ μœ μ‚¬ν•˜λ‹€κ³  λŠκΌˆλ‹€.

μ•„λž˜ ν–‰μœΌλ‘œ λ‚΄λ €κ°€κΈ° 전에 각 ν–‰μ˜ 각 μ—΄μ—μ„œ λ§Œλ“€ 수 μžˆλŠ” κ°€μž₯ 큰 탐사 κ°€μΉ˜λ₯Ό DP에 μ €μž₯μ‹œν‚¨ ν›„, μ•„λž˜ ν–‰μœΌλ‘œ λ„˜μ–΄κ°€λ©΄ λœλ‹€κ³  μƒκ°ν•˜μ˜€λ‹€.




λ‘œλ΄‡μ˜ μ‹œμž‘ μœ„μΉ˜λŠ” μ•„λž˜μ™€ 같이 μ •ν•΄μ Έμžˆλ‹€.

image

μ‹œμž‘ ν–‰μ—μ„œλŠ” 였λ₯Έμͺ½μœΌλ‘œ 갈 수 밖에 μ—†λ‹€.

이 λ•Œ, 였λ₯Έμͺ½μœΌλ‘œ κ°€λ©΄μ„œ λˆ„μ  값을 μ €μž₯ν•˜λ©΄μ„œ 진행해쀀닀.

image




이제 λ‹€μŒ ν–‰μœΌλ‘œ λ‚΄λ €κ°€μ€€λ‹€.

οΏ½μš°λ¦¬λŠ” 이 λ•Œ 두 가지 μΌ€μ΄μŠ€λ‘œ λ‚˜λˆ μ„œ 생각해볼 수 μžˆλ‹€.

1. οΏ½μ™Όμͺ½ -> 였λ₯Έμͺ½μœΌλ‘œ νƒμƒ‰ν•˜λŠ” 경우

2. 였λ₯Έμͺ½ -> μ™Όμͺ½μœΌλ‘œ νƒμƒ‰ν•˜λŠ” 경우




λ¨Όμ €, 였λ₯Έμͺ½ -> μ™Όμͺ½μœΌλ‘œ νƒμƒ‰ν•˜λŠ” 경우λ₯Ό μƒκ°ν•΄λ³΄μž.

image

μš°λ¦¬λŠ” 이번 ν–‰ μ™Όμͺ½ λμ—μ„œ μ‹œμž‘ν•΄μ„œ 였λ₯Έμͺ½ 끝으둜 갈 것인데,

맀 칸을 탐색할 λ•Œ λ§ˆλ‹€ 이전 ν–‰μ—μ„œ λ°”λ‘œ λ‚΄λ €μ˜¨ 것 vs μ™Όμͺ½μ—μ„œ 였λ₯Έμͺ½μœΌλ‘œ 왔을 λ•Œμ˜ 탐사 κ°€μΉ˜λ₯Ό λΉ„κ΅ν•΄μ„œ 더 큰 것을 λ„£μ–΄μ€€λ‹€.

image
image
image
image




λλ‚œ 것이 μ•„λ‹ˆλ‹€.

또 였λ₯Έμͺ½ -> μ™Όμͺ½μœΌλ‘œ 탐색 ν–ˆμ„ λ•Œμ˜ 결과값은 λ‹€λ₯΄λ‹€.

image
image

...


image




그리고 였λ₯Έμͺ½ -> μ™Όμͺ½μœΌλ‘œ 탐색 ν–ˆμ„ λ•Œμ˜ κ°’κ³Ό μ™Όμͺ½ -> 였λ₯Έμͺ½μœΌλ‘œ 탐색 ν–ˆμ„ λ•Œμ˜ 더 큰 값을 μ΅œμ’…μ μœΌλ‘œ DP에 κΈ°μž…μ€€λ‹€.

image
image




맀 행을 탐색할 λ•Œ λ§ˆλ‹€ μœ„ 과정을 λ°˜λ³΅ν•˜κ³  더 큰 κ°’μœΌλ‘œ κ°±μ‹ ν•΄μ£ΌλŠ” ν–‰μœ„λ₯Ό λ§ˆμ§€λ§‰ ν–‰κΉŒμ§€ λ°˜λ³΅ν•΄μ£Όλ©΄ 끝!!!!!!!

πŸ“š μƒˆλ‘­κ²Œ μ•Œκ²Œλœ λ‚΄μš©

@tgyuuAn
Copy link
Member Author

tgyuuAn commented Aug 6, 2024

@SeongHoonC @alstjr7437 λ‹Ήμ‹ λ“€ λ„ˆλ¬΄ν•΄
γ…œγ…œ

@tgyuuAn tgyuuAn merged commit 09bd4d2 into main Aug 6, 2024
@tgyuuAn tgyuuAn deleted the 66-tgyuuAn branch August 6, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
λ‚΄λ‹€ 버린 PR πŸ—‘οΈ tgyuuAn ν•œ μ€„λ‘œλŠ” μ†Œκ°œν•  수 μ—†λŠ” λ‚¨μž.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant