백준

알고리즘 문제 풀이/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(){ ..

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

180423_10825_국영수

//https://www.acmicpc.net/problem/10825 #include #include #include #include #include using namespace std; struct stu{public: string name; int kor; int eng; int math;}; bool cmp(stu a, stu b){ if(a.kor>b.kor) return true; if(a.kor==b.kor){ if(a.eng b.math) return true; if(a.math==b.math) { if(a.name.compare(b.name) a.name; scanf("%d %d %d", &a.kor..

bong sue
'백준' 태그의 글 목록 (4 Page)