2018 상반기 오후 1번 문제 / 드래곤 커브 #60
-
코드트리 문제풀이 백준 드래곤커브랑 똑같음 |
Beta Was this translation helpful? Give feedback.
Answered by
Jinsun-Lee
Apr 26, 2025
Replies: 0 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
아래 얘는 동작하고 void dragon(int x, int y, int d, int g) {
...
map[y][x] = 1;
ny = y; nx = x; // ⭐⭐⭐
for (int i = 0; i < mov.size(); i++) {
ny += dy[mov[i]]; // ⭐⭐⭐
nx += dx[mov[i]];
if (ny > MX - 1 || nx > MX - 1 || ny < 0 || nx < 0) continue;아래는 동작하지 않는 이유 void dragon(int x, int y, int d, int g) {
...
map[y][x] = 1;
for (int i = 0; i < mov.size(); i++) {
ny = y + dy[mov[i]]; // ⭐⭐⭐
nx = x + dx[mov[i]];
if (ny > MX - 1 || nx > MX - 1 || ny < 0 || nx < 0) continue;가장 끝점에 대해서 이어가야 하니까 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
제한 조건이 동일한데, 백준이랑 코테 다르게 동작 |
Beta Was this translation helpful? Give feedback.
0 replies
-
리뷰1// dragon 함수 전부...
vector<int> mov;
int dir, ny, nx;
void dragon(int x, int y, int d, int g) {
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Jinsun-Lee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
리뷰1