Skip to content

Conversation

@flowjiyun
Copy link
Contributor

삽질

  1. 불이 아예 없을 때 반례를 생각하지 못해서 오래 걸렸습니다...
  2. 이차원 배열을 -1로 초기화하는 경우 주의 할 점
  • -1이 의미하는 바는 bfs의 대상이 갈 수 있는 모든 경우이다.
  • -1이 음수이기 때문에 조건식에서 대소 비교를 할 때 주의하여 비교할 필요가 있다.
  • 양수 vs 양수 비교를 의도 하였지만 -1때문에 의도한 조건식를 벗어나는 경우가 생길 수 있다.

@flowjiyun flowjiyun linked an issue Dec 5, 2022 that may be closed by this pull request
1 task
}
if (pos[nx][ny] >= 0 || board[nx][ny] == '#')
continue ;
if (fire[nx][ny] != -1 && pos[cur.X][cur.Y] + 1 >= fire[nx][ny])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 이 불이 없을 때 조건 체크해주는 걸 놓쳐서 틀렸었네요

@ji-junhyuk ji-junhyuk merged commit 56e62a1 into main Dec 6, 2022
@ji-junhyuk ji-junhyuk deleted the day4_flowjiyun branch December 6, 2022 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2022.12.3(SAT) 바킹독 알고리즘 부수기 (Day4)

3 participants