탐색

알고리즘 문제 풀이/1DP_과제(~180615)

180426_1236_성 지키기

//https://www.acmicpc.net/problem/1236 #include #include using namespace std; int main(){ bool chk[50][2]={0,}; int n, m; cin >> n >> m; for(int i=0; i> s; for(int j=0; j

알고리즘 문제 풀이/1DP_과제(~180615)

180425_1568_새

//https://www.acmicpc.net/problem/1568 #include using namespace std; int main(){ int n; cin >>n; int ans=0; while(1){ for(int i=1; n>=i ; i++){ n-=i; ++ans; } if(n==0) break; } cout

알고리즘 문제 풀이/1DP_과제(~180615)

180424_1032_베스트셀러

//https://www.acmicpc.net/problem/1032 #include #include #include #include using namespace std; struct book{ int idx; int cnt; string title; book(); book(int idx, string title, int cnt) : idx(idx), title(title), cnt(cnt) {}}; bool cmp(book a, book b){ if(a.cnt != b.cnt) return a.cnt> b.cnt; else { if(a.title.compare(b.title) < 0) return true; //사전 순으로 a가 b의 앞일 때 else return false; }}int main(){ ..

bong sue
'탐색' 태그의 글 목록