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

[이윤정] 11주차 과제 제출합니다. #19

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

Conversation

yunjeongiya
Copy link
Collaborator

@yunjeongiya yunjeongiya commented May 23, 2022

  • 1593
  • 11578
  • 14497
  • 14575
  • 20313
  • 20955
  • 23888
  • 24391

@yunjeongiya yunjeongiya changed the title week10 [이윤정] 11주차 과제 제출합니다. May 23, 2022
Comment on lines +37 to +43
//조합 구현 어떻게...?
for (int i = 1; i <= M; i++) //1번부터 M번까지 학생
{
for (int j = 1; j <= N; j++)
{
}
}
Copy link

Choose a reason for hiding this comment

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

C++에는 조합함수가 없군요.. 비트마스킹으로도 해결할 수 있습니다.

Copy link
Owner

Choose a reason for hiding this comment

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

비트마스킹 방법으로 리팩터링하는 것은 현재로썬 꽤 어려워보입니다. 백트래킹을 현재 인덱스부터 도는 방법으로 한번 해결해보세요. 만약 아직도 어렵다면 저한테 카톡 또는 디스커션 열어주시면 코드 봐드릴게요.

cin >> N >> M;

//입력의 양이 방대하므로 빠른 입력 사용 권장...
bool G[100001][100001] = { 0, };
Copy link

Choose a reason for hiding this comment

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

100000x100000 이면 어떻게 되나요?

{
int x = now.first + ways[i][0];
int y = now.second + ways[i][1];
if (1 <= x && x <= N && 1 <= y && y <= M && !visited[x][y])
Copy link

Choose a reason for hiding this comment

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

x= 301이거나 y=301가 들어오면 살짝 위험해 보입니다.

Q.push(make_pair(x, y));
break;
case '#':
cell[x][y] = 'x';
Copy link

Choose a reason for hiding this comment

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

생략 가능해 보입니다.

@kth990303 kth990303 requested a review from ziheehan May 26, 2022 06:20
Comment on lines 33 to 34
//����, ���� ���� gcd ���ϸ� �׻� �Ǵ� ���??
//a+d, a+3d -> a+d, 2d -> ?
Copy link
Owner

Choose a reason for hiding this comment

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

유클리드 호제법의 원리를 공부해볼까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

유클리드 호제법 따라서 a랑 a+d의 최대공약수 구하면 a+d%a=d라서 a,d 돌린거랑 같아지는건 확인했었는데
a+d랑 a+3d일 때는
a+3d%a+d = 2d
2d % a+d = ...? 에서 어떻게 증명해야 될 지 모르겠습니다ㅠㅠ!

Copy link
Owner

Choose a reason for hiding this comment

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

제가 볼 때엔 차가 2d인 경우의 최대공약수를 구할 때가 없어보여요! 혹시 언제 차가 2d일 때 최대공약수를 구할 일이 있는지 여쭤봐도 될까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아아아 범위 내 모든 항들에 대해서니까 항상 연속된 항들에 대해서 연산하게 되어서 다 차가 d군요 감사합니다!

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