Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[동적계획법] 9월 27일 #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

[동적계획법] 9월 27일 #6

wants to merge 2 commits into from

Conversation

uommou
Copy link
Collaborator

@uommou uommou commented Oct 3, 2022

내용 & 질문

20055 번은 틀렸지만 어디가 잘못된건지 잘 모르겠습니다. 첨삭을 부탁드려도 될까요?
20923 번에 for문으로 작성하였다가 while문으로 수정하여 맞았던 부분이 있는데(주석에 표시해두었습니다) 이 둘이 어떻게 다른지 잘 모르겠습니다.

<기존 제출>

20923, 11048

<추가 제출>

11053, 20055

@uommou uommou changed the title Add files via upload [동적계획법] 9월 27일 Oct 3, 2022
Copy link

@jk0527 jk0527 left a comment

Choose a reason for hiding this comment

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

P3. 11048 코드리뷰 완료

채원님 안녕하세요!
코드가 정말 깔끔하게 작성되었네요! 🥰
사소한 코멘트로는 vector를 새로 선언하지 않고 원래 vector 값을 갱신하며 구현하는 방법도 있습니다!!
11048은 이대로 머지하셔도 될 것 같아요! 수고 많으셨습니다!
궁금한 것이 있으면 리뷰어를 호출해주세요!!😎😎

Comment on lines +17 to +19
ans = max_candy[n][m];

return ans;
Copy link

Choose a reason for hiding this comment

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

바로 max_candy[n][m]을 리턴하셔도 됩니다!

Comment on lines +28 to +29
vector<vector<int>> candy(n+1, vector<int>(m+1, 0));
vector<vector<int>> max_candy(n+1, vector<int>(m+1, 0));
Copy link

Choose a reason for hiding this comment

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

더미 인덱스 사용하신 것 너무 좋습니다!! 새로 max_candy vector를 만들어도 되고 candy vector에 직접 더해도 됩니다!!

@kwakrhkr59
Copy link

[추가제출 확인 완료]
안녕하세요 채원님~ 추가제출 확인 완료되셨습니다😊
이번 과제도 수고 많으셨습니다:)

@Dong-droid
Copy link

Dong-droid commented Oct 10, 2022

** P3 20923 코드 리뷰 완료**
늦게 코드 리뷰 드려서 죄송합니다 😭
아래에 질문하신 것에 대한 답변과 추가로 제안드리는 점을 적어봤습니다.
코드가 너무 👍 👍 💯 🥇 !!! 😄 고생하셨습니다 🔥 🔥

Comment on lines 32 to 37
//for (int i = 0; i < do_ground.size(); i++) {
// su_card.push_back(do_ground.back());
// do_ground.pop_back();
//}
// �̷��� �ۼ��ߴµ� Ʋ�ȴ�.
// while ����� �ٲ��ִ� �¾Ҵµ� ���� ���̰� ���� �𸣰ڴ�.
Copy link

@Dong-droid Dong-droid Oct 10, 2022

Choose a reason for hiding this comment

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

do_ground.size() 는 계속 1씩 줄어듭니다
i는 반면에 계속 1씩 늘어납니다.
그러면, do_ground.size()와 i가 같아지는 순간이 생기게 되고,
이것은 do_ground에 있는 모든 카드를 pop해주지 않고 for문이 종료가 됩니다!!! 🐧

Comment on lines +52 to +65
while (!su_ground.empty()) {
do_card.push_back(su_ground.back());
su_ground.pop_back();
}
while (!do_ground.empty()) {
do_card.push_back(do_ground.back());
do_ground.pop_back();
}
}

turn++;
}

// ���
Copy link

@Dong-droid Dong-droid Oct 10, 2022

Choose a reason for hiding this comment

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

P3. 합쳐지는 카드 덱(des)과 합치는 카드 덱(src)만 다를 뿐 수연이와 도도가 종을 친 후에 동일한 일을 하고 있지 않나요?? ❓
그래서, des와 src를 매개변수로 하여 이를 함수화하면 더 좋을 것 같습니다!! 🦒 🐘

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.

4 participants