![[C++] 백준 14단계 1764번 문제 (듣보잡)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FQZCT7%2FbtsoyIvx1Uz%2F3kHKaXnkiYq4wbuSESWg20%2Fimg.png)
문제설명 소스코드 #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); //표준 스트림 동기화 해제 cin.tie(0); //입출력 연결 끊기 vectorv1, v2; int N, M; cin >> N >> M; for (int i = 0; i > input; v1.push_back(input); } sort(v1.begin(), v1.end()); //v1 정렬 for (int i = 0; i > input; if (binary_search(v1.begin(), v1.end(),..
![[C++] 백준 14단계 - 10816번 문제 (숫자 카드 2)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmDOsn%2FbtsoyXZtoaX%2FusiBDXIbPeYbSX9A5ZPdxk%2Fimg.png)
문제설명 소스코드 #include #include using namespace std; int main(void) { ios_base::sync_with_stdio(false); //표준 스트림 동기화 해제 cin.tie(nullptr); //입출력 연결 끊기 map m; int N, M; cin >> N; for (int i = 0; i > input; ++m[input]; } cin >> M; for (int i = 0; i > input; cout
![[C++] 백준 14단계 - 14425번 문제 (문자열 집합)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbuxqsZ%2FbtsoxIhdlmH%2FpTr5SImRkP4kiq0CKa9u9k%2Fimg.png)
문제설명 소스코드 #include #include using namespace std; int main(void) { map m; int N, M; int count = 0; cin >> N >> M; for (int i = 0; i > str; m.insert(pair(str, true)); } for (int i = 0; i > str; if (m[str] == true) count++; } cout
![[C++] 백준 14단계 - 10815번 문제 (숫자 카드)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FBcKsy%2FbtsoqPfUDjK%2FVZRhJWvlxlf6Im1kzQU9uK%2Fimg.png)
문제설명 소스코드 #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); //표준 스트림 동기화 해제 cin.tie(nullptr); //입출력 연결 끊기 int N, M; vector vec; cin >> N; for (int i = 0; i > input; vec.push_back(input); } sort(vec.begin(), vec.end()); cin >> M; for (int i = 0; i > input; cout
![[C++] 백준 13단계 - 1181번 문제 (단어 정렬)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcBhD38%2Fbtsn0D8d3U7%2FzdI5QfHrhBJN13EqKtzoQK%2Fimg.png)
문제설명 소스코드 #include #include using namespace std; bool compare(string a, string b) { if (a.length() != b.length()) return a.length() > N; string* arr = new string[N]; for (int i = 0; i > arr[i]; sort(arr, arr + N, compare); for (int i = 0; i < ..
![[C++] 백준 13단계 - 18870번 문제 (좌표 압축)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdq13bf%2Fbtsoe0Dl95g%2Fmf0IuEQN0gL4bIkwCcrsbK%2Fimg.png)
문제설명 소스코드 #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); //표준 스트림 동기화 해제 cin.tie(NULL); //입력과 출력 연결 끊기 vector original, tmp; int N; cin >> N; for (int i = 0; i > input; original.push_back(input); //원본 벡터에 입력받음 tmp.push_back(input); //임시 벡터에 입력받음 } sort(tmp.begin(), tmp.end()); //임시 벡터 정렬 tmp.erase(unique(tmp.begin(), tmp..
![[C++] 백준 13단계 - 11651번 문제 (좌표 정렬하기 2)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fw3DBu%2FbtsnEWaCIkV%2Fw3T4PQgmztCzEIY1iXj4L0%2Fimg.png)
문제설명 소스코드 #include #include using namespace std; class XY { public: int x; int y; bool operator y y == arr.y) && (this->x > N; XY* arr = new XY[N]; for (int i = 0; i < N; ++i) cin ..
![[C++] 백준 13단계 - 10814번 문제 (나이순 정렬)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FsKOFv%2Fbtsn7s7mxa0%2FhEjiyLm82kKwKwSesnEgV1%2Fimg.png)
문제설명 소스코드 sort() 이용(quick sort) #include #include using namespace std; class name_age { public: string name; int age; int idx; bool operator age != arr.age) return this->age idx > N; name_age* arr = new name_age[N]; fo..