Comments (2)
안녕하세요, azurealstn 님!
dx와 dy 리스트는 함께 사용되며 차례대로 상, 하, 좌, 우의 방향을 의미하는 정보를 담고 있습니다.
일반적으로 문제에서 2차원 공간이 제시되면, 이는 수학의 행렬(Matrix)과 유사한 의미를 가지는 경우가 많습니다.
이때 특정한 위치(x, y)를 기준으로 하여 상, 하, 좌, 우의 방향 벡터를 각각 나타내면 다음과 같습니다.
상: (-1, 0)
하: (1, 0)
좌: (0, -1)
우: (0, 1)
그래서 만약 다음 위치를 결정하고자 할 때, 상(위쪽) 방향으로 가고자 한다면 다음과 같이 nx, ny 값이 대입됩니다.
nx = x + dx[0]
ny = y + dy[0]
다시 말해 nx에는 x - 1이, ny에는 y 값이 그대로 대입되는 형태입니다. 이는 행렬 상에서 현재 위치에서 위쪽으로 이동하는 것과 같다고 볼 수 있습니다. 혹시 아직 이해가 안 가시는 부분이 있으시다면 편하게 말씀해주세요!
감사합니다.
나동빈 드림
from python-for-coding-test.
이제 이해갔습니다!
자세한 설명 감사합니다.
from python-for-coding-test.
Related Issues (20)
- p.300 도시 분할 계획 java 풀이 관련 질문입니다. HOT 1
- 경쟁적 전염 질문
- 음료수 얼려먹기 실전문제 질문
- 퀵 정렬시 재귀함수 동작방식 질문 HOT 1
- [BFS 정의 구현 코드]
- 다익스트라 java코드 관련 문의 HOT 1
- 6-12.py 답안 예시 질문
- 다이나믹 프로그래밍 imporved recursive fibonacci
- 바닥공사 해설에 오류가 있는거 같아요 HOT 1
- p.92 큰 수의 법칙 reverse=True 사용안한 이유가 궁금합니다!
- p.339 Q15) 특정 거리의 도시 찾기 문제 백준 오류 HOT 2
- 개선된 다익스트라 자바 코드 질문
- 개선된 다익스트라 자바 코드 질문
- 구현 - 시각 파이썬 소스코드 오류 질문입니다. 113pg
- [그리디] 1이 될때까지 질문있습니다.
- part03. 21번 인구이동
- 시간복잡도 계산법 질문 드려요~
- 4단원 구현의 게임개발의 답안에 오류가 있다고 생각됩니다.
- chapter 13 dfs/bfs 문제 Q19 연산자 끼워 넣기 답안 수정이 필요합니다 (page 538). HOT 1
- 120 페이지 게임 개발 질문
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-for-coding-test.