Skip to content

그리드 [9월 23일] #7

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

그리드 [9월 23일] #7

wants to merge 1 commit into from

Conversation

sua005
Copy link
Collaborator

@sua005 sua005 commented Sep 23, 2024

인적사항
이름: 조수아
학번: 2371060

과제 제출
기존 제출: 17451, 1213, 15662

인적사항
이름: 조수아
학번: 2371060

과제 제출
기존 제출: 17451, 1213, 15662

//펠린드롬을 만들 수 있는지 확인
if (!canFormPalindrome(alpha, oddNum, midNum)) {
cout << "I'm Sorry HanSoo"; // 만들 수 없는 경우

Choose a reason for hiding this comment

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

로직에는 이상이 없습니다!
다만 출력 형식에 오류가 있는 것 같네요 ㅎㅎ
'I'm Sorry HanSoo' 가 아니라 'I'm Sorry Hansoo' 로 고치면 맞게 제출 될 겁니다!

Copy link

@avocado8 avocado8 left a comment

Choose a reason for hiding this comment

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

15662(p3)
수아님 안녕하세요 :3 15662번 코드리뷰 드렸습니다.
잘 풀어주셔서 따로 드릴 코멘트는 없었습니다!
질문이 있으시다면 언제든 편히 리뷰어를 호출해주세요~

visited[num] = true;
rotations.push_back({ num, dir });

//BFS 방식으로 인접한 톱니바퀴를 탐색하며 회전 여부 결정
Copy link

Choose a reason for hiding this comment

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

문제의 조건에 맞게 회전을 잘 구현해주셨네요 :3

Comment on lines +3 to +4
#include <queue>
#include <deque>
Copy link

Choose a reason for hiding this comment

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

덱과 큐 자료구조를 적극 활용한 코드작성 멋졌습니다 🤗👍

Copy link

@kimeunsom kimeunsom left a comment

Choose a reason for hiding this comment

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

(17451) 평행우주 문제는 각 단계마다 조건을 만족하는 가능한 적은 속도로 업데이트해나가면서 최적해를 확장해나가는 그리디 문제였습니다 ! 매 단계 가장 적은 속도를 탐욕적으로 선택하면 정답을 구할 수 있었습니다 :) 그리디한 접근법으로 잘 구현해주셨어요 ! 고생 많으셨습니다 ~
(튜터의 개인적 사정으로 코드 리뷰가 늦어진 점 사과드립니다.)

cin >> arr[i];
}

cout << calculateResult(arr, n) << "\n";

Choose a reason for hiding this comment

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

깔끔한 연산부 함수화가 좋습니다 :)


int n;
cin >> n;
int arr[300000]; //배열 선언

Choose a reason for hiding this comment

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

(p3) 최대 크기로 배열을 미리 선언해두셨군요 ~ 사용하지 않는 공간의 낭비를 막기 위해 vector로 선언 후 push_back을 사용해보거나, assign 함수로 선언 이후에 n만큼의 공간을 할당해주는 방안도 있답니다 :) 참고하세요 !

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