전체 글 (454) 썸네일형 리스트형 [Level 2][C++] 최솟값 만들기 #include #include#include using namespace std;int solution(vector A, vector B){ sort(A.begin(), A.end()); sort(B.begin(), B.end(), greater()); int answer = 0; for(int i=0; i [Level 2][C++] 행렬의 곱셈 #include #include using namespace std;vector> solution(vector> arr1, vector> arr2) { vector> answer(arr1.size()); for(int i=0; i i 첫번째 행렬의 행, j 첫번째 행렬의 열이자 두번째 행렬의 행, k 두번째 행렬의 열 [Level 2][C++] 전화번호 목록 풀이 1 - 해시테이블 이용#include #include using namespace std;bool solution(vector phone_book) {//전화번호 앞자리를 기준으로 해시 테이블에 정리한다. vector> hashT(10); for(int i=0; i 풀이 2 - 정렬해서 푼다.#include #include #include using namespace std; bool solution(vector phone_book) { sort(phone_book.begin(), phone_book.end()); //내림차순으로 정렬 for(int i=0; i 이전 1 ··· 4 5 6 7 8 9 10 ··· 152 다음