백준 알고리즘/구현85 백준 5543번 C++ #include #include using namespace std; int hamburger[3];int beverage[2]; int mincost() {int minc = 987654321; for (int i = 0; i > hamburger[i];}for (int i = 0; i > beverage[i];}cout 2019. 2. 18. 백준 13458번 C++ #includeusing namespace std; const int MAX = 1000001;int n, b, c;int student[MAX]; void calexam() {long long ans = 0; for (int i = 0; i b) {student[i] -= b;ans += student[i] / c;if (student[i] % c > 0)ans++;}}cout n;for (int i = 0; i > student[i];}cin >> b >> c;calexam();} 2019. 1. 26. 백준 1890번 C++ #include#includeusing namespace std; int n;int arr[101][101];long long ans[101][101]; long long calway() {ans[0][0] = 1; for (int i = 0; i < n; i++) {for (int j = 0; j < n; j++) {if (ans[i][j] != 0 && i != n-1 && i+arr[i][j]< n) {ans[i + arr[i][j]][j] += ans[i][j];}if (ans[i][j] != 0 && j!= n-1 && j+arr[i][j] < n ) {ans[i][j + arr[i][j]] += ans[i][j];}}}return ans[n - 1][n - 1];} int main(void) .. 2019. 1. 23. 백준 7568번 C++ #include #include using namespace std; typedef struct {int height;int k;}Info; int main(void) {int count; cin >> count;Info arr[51];for (int i = 0; i > height >> k;arr[i].height = height;arr[i].k = k;} for (int i = 0; i < count; i++) {int ans = 0;for (int j = 0; j < count; j ++ ) {if ((arr[i].height < arr[j].height) && (arr[i].k < arr[j].k))ans++;}cout 2019. 1. 5. 이전 1 ··· 14 15 16 17 18 19 20 ··· 22 다음