그럴듯한 개발 블로그
[프로그래머스 고득점kit] 해시_베스트앨범(c++)

https://school.programmers.co.kr/learn/courses/30/parts/12077 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include using namespace std; bool greater_plays(pair a, pair b) { return (a.second > b.second); // 내림차순으로 정렬 } bool unique_greater_plays(pair a, pair b) { if (a.second == b.second) return a.first <..

[프로그래머스 고득점kit] 해시_위장(c++)

https://school.programmers.co.kr/learn/courses/30/parts/12077 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; int solution(vector clothes) { int answer = 1; unordered_map map; vector type; for (int i = 0; i < clothes.size(); i++) { if (map.find(clothes[i][1]) == map.end()) { map[clothes..

백준 1620 (c++) 나는야 포켓몬 마스터 이다솜
<algorithm>/백준 2023. 4. 6. 20:15

https://www.acmicpc.net/problem/1620 1620번: 나는야 포켓몬 마스터 이다솜 첫째 줄에는 도감에 수록되어 있는 포켓몬의 개수 N이랑 내가 맞춰야 하는 문제의 개수 M이 주어져. N과 M은 1보다 크거나 같고, 100,000보다 작거나 같은 자연수인데, 자연수가 뭔지는 알지? 모르면 www.acmicpc.net // 회사에 있는 사람 #include #include #include #include #include using namespacestd; intmain() { ios::sync_with_stdio(0),cin.tie(0); unordered_mapmap; intsize, n; stringinput; vectordogam; cin >> size >> n; dogam.p..

백준 7785 (c++) 회사에 있는 사람
<algorithm>/백준 2023. 4. 6. 17:11

https://www.acmicpc.net/problem/7785 7785번: 회사에 있는 사람 첫째 줄에 로그에 기록된 출입 기록의 수 n이 주어진다. (2 ≤ n ≤ 106) 다음 n개의 줄에는 출입 기록이 순서대로 주어지며, 각 사람의 이름이 주어지고 "enter"나 "leave"가 주어진다. "enter"인 경우는 www.acmicpc.net // 회사에 있는 사람 #include #include #include #include #include using namespacestd; intmain() { ios::sync_with_stdio(0),cin.tie(0); unordered_setset; stringname, status; intn; cin >> n; while (n--) { cin >> ..

[프로그래머스 고득점kit] 해시_전화번호 목록(c++)

https://school.programmers.co.kr/learn/courses/30/parts/12077 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; bool solution(vector phone_book) { int num = phone_book.size(); sort(phone_book.begin(), phone_book.end()); for (int i = 0; i < num - 1; i++) if (phone_book[i] == phone_book[i +..

[프로그래머스 고득점kit] 해시_완주하지 못한 선수(c++)

https://school.programmers.co.kr/learn/courses/30/parts/12077 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; string solution(vector participant, vector completion) { string answer = ""; sort(participant.begin(), participant.end()); sort(completion.begin(), completion.end()); for (int i..