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일 #9

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

[그리디] 9월 27일 #9

wants to merge 5 commits into from

Conversation

sooooscode
Copy link
Collaborator

학번: 2176077
이름: 김연수

###과제제출
기존제출:
1213.cpp
17451.cpp
18111.cpp
19539.cpp
큰_수_만들기.cpp

Copy link

@chae-jpg chae-jpg left a comment

Choose a reason for hiding this comment

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

[그리디 알고리즘 코드 리뷰 완료]

1213(P3), 17451(P3)

안녕하세요 연수님! 코드 리뷰 완료되었습니다👍
주석 처리도 좋고, 문제도 깖끔하게 잘 풀어주셨습니다!
도전 문제까지 모두 푸시느라 정말 수고 많으셨어요👍
몇 가지 사소한 코멘트 남겼습니다.
궁금하신 점이 있다면 리뷰어를 호출해주세요!

Comment on lines +36 to +39
if (odd_count > 1)
{
cout << "I'm Sorry Hansoo" << "\n";
}

Choose a reason for hiding this comment

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

팰린드롬을 만들 수 없는 조건을 잘 발견해주셨네요!👍

else
{
string second_half = first_half;
reverse(second_half.begin(), second_half.end());

Choose a reason for hiding this comment

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

reverse 함수를 사용해서 문자열을 깔끔하게 뒤집어주셨네요!

Comment on lines +23 to +31
for (int i = n - 2; i >= 0; i--)
{
if (velocity < planet[i]) {
velocity = planet[i];
}
else if (planet[i] < velocity && velocity % planet[i] != 0) {
velocity = ((velocity / planet[i]) + 1) * planet[i];
}
}

Choose a reason for hiding this comment

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

최소 속도를 만드는 조건을 파악해서 문제를 잘 풀어주셨네요!👍

Copy link
Member

@Goldchae Goldchae left a comment

Choose a reason for hiding this comment

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

[그리디 알고리즘 구현 코드 리뷰 완료]
18111 (P3)
전체적으로 깔끔하고 좋은 코드로 작성해주셨네요! 코멘트 남긴 부분 확인해주세요! 수고하셨습니다!


using namespace std;

int main()
Copy link
Member

Choose a reason for hiding this comment

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

p3. 기능별로 함수를 분리해서 적어주셨으면 좋았을 것 같습니다!

}
}

int min_time = 1e9; // 초기 최소 시간을 큰 값으로 설정
Copy link
Member

Choose a reason for hiding this comment

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

c++에서 최댓값(INF)을 다루는 여러 가지 방법에 대해 찾아보셔도 좋을 것 같네요!

if (diff > 0)
{
time += diff * 2; // 블록 제거 시간
blocks_in_inventory += diff; // 인벤토리에 블록 추가
Copy link
Member

Choose a reason for hiding this comment

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

주석 남겨 주신 부분 좋습니다!

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