Conversation
bsa0322
requested changes
Oct 4, 2021
bsa0322
left a comment
There was a problem hiding this comment.
p1. 전반적으로 잘 풀어주셨어요!! 3190만 수정한 후, 저 다시 리뷰어로 호출해주세요! 수고하셨습니다~!
Comment on lines
+7
to
+9
| int min(int a, int b, int c){ | ||
| return b > a ? c > a ? a : c : c > b ? b : c; | ||
| } |
There was a problem hiding this comment.
p2. 삼항연산자는 가독성이 안 좋아서 최대한 피하는 게 좋아요! min 함수 2개 쓰거나, 반복문 활용해서 작성해주시면 좋을 것 같아요!
Comment on lines
+22
to
+25
| if(i+counsel[i].d < n+1) // 상담 마지막 날 다음 날 dp가 있으면 | ||
| dp[i] = max(dp[i+counsel[i].d]+counsel[i].m, dp[i+1]); | ||
| else // 상담 마지막 날 다음 날 dp가 없으면 | ||
| dp[i] = max(counsel[i].m, dp[i+1]); |
| int find(vector<vector<int>> dp, vector<vector<int>> cost, int n){ | ||
|
|
||
| int ans [3]; | ||
| for(int i=0; i<3; i++){ |
There was a problem hiding this comment.
p2. 첫 번째 집을 어디로 고정할지를 main에서 정하고, 함수로 보내주면 더 간결하게 작성할 수 있을 것 같아요!
Comment on lines
+36
to
+43
| while(!su_gr.empty()){ | ||
| dodo.push_back(su_gr.back()); | ||
| su_gr.pop_back(); | ||
| } | ||
| while(!do_gr.empty()){ | ||
| dodo.push_back(do_gr.back()); | ||
| do_gr.pop_back(); | ||
| } |
There was a problem hiding this comment.
p2. 어느 덱으로 넣는지와, 어느 그라운드에서 가져오는지 보내주면 함수화 해봐도 좋을 것 같아요~!
Comment on lines
+20
to
+45
| char changeDir(char from, char to){ | ||
| if(from == 'E'){ | ||
| if(to == 'L') | ||
| return 'N'; | ||
| else | ||
| return 'S'; | ||
| } | ||
| else if(from == 'W'){ | ||
| if(to == 'L') | ||
| return 'S'; | ||
| else | ||
| return 'N'; | ||
| } | ||
| else if(from == 'S'){ | ||
| if(to == 'L') | ||
| return 'E'; | ||
| else | ||
| return 'W'; | ||
| } | ||
| else{ | ||
| if(to == 'L') | ||
| return 'W'; | ||
| else | ||
| return 'E'; | ||
| } | ||
| } |
There was a problem hiding this comment.
p1. 방향 관련 배열을 사용하면 더 간편하게 작성할 수 있어요!! 예를 들어 좌표로 표현했을 때, 위로 가는 건 (-1,0)을 현재 좌표에 더해주는 거고, 왼쪽으로 가는 건 (0, -1)을 더해주는 거죠! 이런 식의 상,하,좌,우 변화값을 저장한 배열을 만들어서 관리하면 훨씬 좋아요! 한 번 수정해볼까요!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.