shell script에서의 source 명령어를 실행시키면 다음과 같은 오류가 발생한다 [출처] https://stackoverflow.com/questions/13702425/source-command-not-found-in-sh-shell .을 사용해서 source를 대체할 수 있다
위와 같이 mkdir p 옵션은 중간에 디렉토리명이 없으면 자동으로 생성해준다
특정 n에 대해서는 하나의 해만 존재하므로 다이나믹으로 해결해야만 O(N)만에 해결할 수 있다 문제: https://www.acmicpc.net/problem/1463 깃허브주소: https://github.com/surinoel/boj/blob/master/1463.cpp
map에 정보를 담은 후 vector로 옮긴 뒤 정렬을 한다 map m; vector tmp; for (map::iterator it = m.begin(); it != m.end(); ++it) { tmp.push_back(make_pair(it->first, it->second)); } sort(tmp.begin(), tmp.end(), cmp1);
map과 정렬을 이용해서 해결해야 하는 문제 1. play의 합을 알기 위해서 map에 정보를 넣고 이를 vector에 다시 넣으면서 정렬 2. map에 인덱스 정보를 넣는다 3. 인덱스에 담겨진 장르별 앨범을 모아서 구하게 된다 문제: https://programmers.co.kr/learn/courses/30/lessons/42579# 깃허브주소: https://github.com/surinoel/boj/blob/master/Programmers_베스트앨범.cpp
탐색 대상은 100~999까지로 범위가 좁기 때문에 브루트포스로 모두 탐색할 수 있다. check라는 bool 배열을 통해서 스트라이크와 볼을 구분할 수 있다 문제: https://programmers.co.kr/learn/courses/30/lessons/42841 깃허브주소: https://github.com/surinoel/boj/blob/master/Programmers_숫자야구.cpp