Skip to content

Conversation

@Inryu
Copy link
Member

@Inryu Inryu commented Oct 10, 2021

No description provided.

@Inryu
Copy link
Member Author

Inryu commented Oct 10, 2021

#17829 [222-풀] 문제에서 pooling 함수에서 기저조건에 도달하면 return map[0][0];으로 하고 main에서 바로 출력되도록 했는데 그러면 엄청 큰 수가 뜹니다..! 그렇게 안 하고 기저조건에 바로 cout<<map[0][0];를 넣으면 제대로 된 답이 뜨긴해서 일단 그렇게 했는데 이유를 모르겠습니다..😥

Copy link

@bsa0322 bsa0322 left a comment

Choose a reason for hiding this comment

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

p1. 잘 풀어주셨네요!! 질문에 대한 코멘트는 아래 남겼습니다! 17281 인덱스 에러 부분은 꼭 수정 후, 리뷰어로 저 다시 호출해주세요!! 수고하셨습니다~!!

Comment on lines +14 to +26
Copy link

Choose a reason for hiding this comment

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

p2. 방문 체크한 값을 통해 이미 지워진 구슬은 제외하도록 풀이해주신 거 좋아요!! 그런데 구슬을 직접 '지우는' 풀이로 하면 더 간단하게 구현할 수 있어요~!! 벡터의 원소 값을 지우는 함수가 있어요! 더불어 다시 돌아왔을 때 재탐색이 가능하도록 하기 위해 삽입을 하는 함수도 알아야겠네요.

Comment on lines +15 to +23
Copy link

Choose a reason for hiding this comment

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

p3. 움직이는 부분 함수로 만들어 주신 거 완전 좋아요!!! 사소한 코멘트인데 base[i] = false 코드가 중복되니 지금 있는 if문 2개는 공통되는 조건이 큰 if문으로 오게 하나로 합쳐도 좋겠네요~!!

Comment on lines +76 to +78
Copy link

Choose a reason for hiding this comment

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

p1. player의 배열 크기는 8인데 인덱스는 8까지 참조하고 있네요!

Comment on lines +81 to +87
Copy link

Choose a reason for hiding this comment

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

p3. 벡터의 삽입 함수를 활용하면 더 간단하게 바꿔볼 수 있을 것 같아요!

Comment on lines +26 to +30
Copy link

Choose a reason for hiding this comment

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

size가 1이어서 해당 if문에 걸리는 현재 함수는, 호출의 가장 마지막 함수예요!
그래서 return map[0][0]을 하면 바로 main에 보내주는 게 아니라 호출을 당한 전 함수로 계속 리턴해줘요!
그런데 지금 작성해주신 pooling함수는 호출 시 리턴 값을 따로 저장하거나, 다시 리턴해주는 부분이 없으니 main으로 보내주는 게 없어 쓰레기 값이 출력된 것 같습니다!!

Comment on lines +11 to +19
Copy link

Choose a reason for hiding this comment

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

p3. 아래 for문에서 9등분씩 계속 분할해주는 걸 생각하면 지금 코드를 더 짧게 줄일 수 있겠네요! 하지만 3에서 끊어주신 것도 시간을 조금 더 절약할 수 있을테니 좋아요~~!!

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.

3 participants