본문 바로가기

해시를 사용한 집합과 맵4

백준 9375번 : 패션왕 신해빈 [C++] 주소 : https://www.acmicpc.net/problem/9375 9375번: 패션왕 신해빈 첫 번째 테스트 케이스는 headgear에 해당하는 의상이 hat, turban이며 eyewear에 해당하는 의상이 sunglasses이므로 (hat), (turban), (sunglasses), (hat,sunglasses), (turban,sunglasses)로 총 5가지 이다. www.acmicpc.net 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; ci.. 2022. 9. 2.
백준 17219번 : 비밀번호 찾기 [C++] 주소 : https://denise.tistory.com/manage/newpost/?type=post&returnURL=%2Fmanage%2Fposts%2F TISTORY 나를 표현하는 블로그를 만들어보세요. www.tistory.com 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include #include #include using namespace std; typedef struct { string address; string password; }Person; bool compare(Person a, Person b) { return a.address < b.address; } int main() { ios_base::sync_with_stdio(false);cin... 2022. 8. 28.
백준 1764번 : 듣보잡 [C++] 주소 : https://www.acmicpc.net/problem/1764 1764번: 듣보잡 첫째 줄에 듣도 못한 사람의 수 N, 보도 못한 사람의 수 M이 주어진다. 이어서 둘째 줄부터 N개의 줄에 걸쳐 듣도 못한 사람의 이름과, N+2째 줄부터 보도 못한 사람의 이름이 순서대로 주어진다. www.acmicpc.net 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int N, M; cin >> N >> M; set l; set s; vecto.. 2022. 8. 26.
백준 1620번 : 나는야 포켓몬 마스터 이다솜 [C++] 주소 : https://www.acmicpc.net/problem/1620 1620번: 나는야 포켓몬 마스터 이다솜 첫째 줄에는 도감에 수록되어 있는 포켓몬의 개수 N이랑 내가 맞춰야 하는 문제의 개수 M이 주어져. N과 M은 1보다 크거나 같고, 100,000보다 작거나 같은 자연수인데, 자연수가 뭔지는 알지? 모르면 www.acmicpc.net 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; typedef struct { int number; string name; }Pokemon; bool compare(Pokemon a, Pokemon b) { return a.name < .. 2022. 8. 26.