-
Notifications
You must be signed in to change notification settings - Fork 0
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
[맵과 셋] 03월 13일 #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체적으로 잘 풀어주셨습니다! 고생 많으셨어요~ 주석도 좋아요:) 5문제 통과로 과제 제출 확인되었습니다.
2776번에는 코멘트 작성하였습니다. 2776번은 해당 원소가 있는지만 체크하는 것이기 때문에 map보다는 set이나 vector에서 이분탐색을 이용하는 것이 좋아요~ 자세한 사항은 코멘트 확인해주세요!
2776번 수정해주시고 오른쪽 상단에 re-request review 버튼 눌러주세요~
03월 08일 - 맵과 셋/20291.cpp
Outdated
} | ||
m[name]++; | ||
} | ||
sort(file.begin(), file.end()); // 사전순으로 정렬 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p1. 이 코드는 어떤 이유로 작성하신건가요?
cout << "0\n"; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p2. 이 문제에서는 map을 사용하지 않고 set을 사용하거나 vector의 이분탐색을 사용하는 것이 좋아요! set을 사용하려면 set 중에서도 unordered_set을 사용해야합니다. unordered_set은 시간복잡도가 O(1)이기 때문이에요. unordered_set과 find함수를 사용하면 시간초과 나지 않고 통과될 것입니다.
그리고 note[temp]는 사용하지 않는 것이 좋을 것 같아요! map에 없는 키가 들어가면 map에 자동으로 insert되기 때문이에요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다~ 머지하셔도 됩니다!
선택 문제 6개 모두 제출하셔서 쿠폰도 1개 적립해드렸습니다~ |
내용 & 질문
<기존 제출>
<추가 제출>