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주차 과제 제출합니다. #18

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

Conversation

ssoheeh
Copy link
Collaborator

@ssoheeh ssoheeh commented May 21, 2022

  • 20955
  • 14497
  • 1953 계속 50%에서 틀립니다. 이유를 모르겠습니다
  • 24391
  • 11578 인터넷에서 코드 가져옴 읽어보면 이해는 되는데 짜는게 안됨
  • 20313
  • 5859
  • 15976
    계속 생각해보고 있는데 너무 어렵네요ㅠㅠ

@ssoheeh ssoheeh changed the title week11 [김소희] 11주차 과제 제출합니다. May 21, 2022
Copy link
Owner

@kth990303 kth990303 left a comment

Choose a reason for hiding this comment

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

이번 문제가 꽤 어려웠죠? 도움되시라고 간단하게 몇 개 코멘트 남긴 것도 있고, 개인적으로 궁금해서 코멘트 남긴 것도 존재합니다. 어려운 만큼 열심히 고민하시다보면 실력도 늘게 될 거예요.
2주 정도 남았네요. 남은 시간 화이팅입니다 🔥

void dfs(int cnt, int idx) { //������ ��� ��, ���� ���
if (cnt >= result) return; //���� ����� ������ ��� ���� ����� �ʿ��� ��� return
if (cnt > 0) {
bool solved[11] = { false, };
Copy link
Owner

Choose a reason for hiding this comment

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

,없어도 모두 초기화됩니다

Suggested change
bool solved[11] = { false, };
bool solved[11] = { false };

Comment on lines 13 to 29
for (int i = 0; i < cnt; i++) {
int cidx = team[i];
//���� ����� Ǯ �� �ִ� ��� �˻�
for (int j = 0; j < can_solve[cidx].size(); j++)
solved[can_solve[cidx][j]] = true;
}
bool avail = true;
for (int i = 1; i <= problem; i++) {
if (!solved[i]) {
avail = false;
break;
}
}
//��� ����� Ǯ �� �ִٸ� �ּ� ��� ����
if (avail)
result = min(result, cnt);
}
Copy link
Owner

Choose a reason for hiding this comment

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

Challenging 🆙
정말 놀랍게도 이 작업을 안할 수 있는 방법이 존재합니다. 하지만 지금 이 방법을 생각해내기엔 어려울 수 있겠네요

can_solve[i].push_back(num);
}
}
dfs(0, 1);
Copy link
Owner

Choose a reason for hiding this comment

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

소희님에게 이 문제가 어떤 부분에서 코드 작성이 어려웠는지 궁금합니다.
어디서 막히셨는지 한 번 설명해주시면 감사하겠습니다!

Comment on lines +48 to +50
if (result == 11) result = -1;
cout << result;
return 0;
Copy link
Owner

Choose a reason for hiding this comment

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

삼항연산자 이용하는 방법도 존재합니다.

Suggested change
if (result == 11) result = -1;
cout << result;
return 0;
cout << (result==11 ? -1 : result);

{
cout << blue.at(i) << " ";
}
cout << endl << white.size() << endl;
Copy link
Owner

Choose a reason for hiding this comment

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

endl 상당히 느리니까 주의하세요~

Copy link

Choose a reason for hiding this comment

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

'\n' 쓰기 힘들거나 귀찮을 때

#define endl '\n'

해놓으면 편리합니다.

Comment on lines +35 to +44
if (it1 == blue.end()&&sum==0) {
blue.push_back(i);
sum++;
}
if (it2 == white.end()&&sum==0) {
white.push_back(i);
sum++;
}
if(sum==0)
blue.push_back(i);
Copy link
Owner

Choose a reason for hiding this comment

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

싫어하는 사람이 없는 사람이 일부 존재한다면 어떻게 될까요?

Comment on lines +53 to +59
if (white.size() == 0) {
blue.erase(blue.begin() + 1);
white.push_back(1);
}if (blue.size() == 0) {
white.erase(white.begin() + 1);
blue.push_back(1);
}
Copy link
Owner

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