알고리즘 문제 풀이/1DP_과제(~180615)
2018.01.04
//https://www.acmicpc.net/problem/13116 #include #include using namespace std;int a[11];int b[11]; int main() { int T, A, B; bool chk; cin >> T; for(int tc=0 ; tc> A >> B; memset(a,0,11*sizeof(int)); memset(b,0,11*sizeof(int)); int j=0; for(int i=A; i>0; i/=2) a[j++]=i; j=0; for(int i=B; i>0; i/=2) b[j++]=i; chk=0; for(int i=0; i
알고리즘 문제 풀이/1DP_과제(~180615)
2018.01.03
//https://algospot.com/judge/problem/read/TRIANGLEPATH#include using namespace std;int dp[101][101];int tri[101][101]; int main(){ int c; cin >> c; for(int t=0; t> n; for(int i=1; i tri[i][j]; dp[1][1]=tri[1][1]; for(int i=1; i
알고리즘 문제 풀이/1DP_과제(~180615)
2018.01.02
//https://www.acmicpc.net/problem/2884 #include using namespace std; int main() { int h,m; cin >> h >> m; if(m
알고리즘 문제 풀이/1DP_과제(~180615)
2018.01.01
//https://www.acmicpc.net/problem/11047#include using namespace std;int money[10]; int main() { int n,K,ans; cin >> n >> K; for(int i=0; i> money[i]; ans=0; for(int i=n-1; i>=0; i--) { if((K/money[i]) >0) ans+=K/money[i]; K%=money[i]; } cout