180302_2600_구슬게임
//https://www.acmicpc.net/problem/2600 #include using namespace std;bool dp[501][501];int b[3];int k[2][5];void find_dp(){ for(int i=0; i> b[0] >> b[1] >> b[2] ; find_dp(); for(int i=0; i> k[0][i] >> k[1][i]; } for(int i=0; i
//https://www.acmicpc.net/problem/2600 #include using namespace std;bool dp[501][501];int b[3];int k[2][5];void find_dp(){ for(int i=0; i> b[0] >> b[1] >> b[2] ; find_dp(); for(int i=0; i> k[0][i] >> k[1][i]; } for(int i=0; i
//https://www.acmicpc.net/problem/11568 #include #include using namespace std;int dp[1001];int num[1001]; int main(){ int N; int mx=1; cin >> N; for(int i=1; i> num[i]; dp[1]=1; for(int i=2; i=0; j--){ if(num[j]
//https://www.acmicpc.net/problem/1563 #include #define mod 1000000using namespace std;int dp[1001][2][3];int N; int find(int today, int late, int absence){ if(today==N) return 1; if(dp[today][late][absence]) return dp[today][late][absence]; //오늘 지각한 경우 if(late==0){ dp[today][late][absence]+=find(today+1, late+1, 0); dp[today][late][absence]%=mod; } //연속 결속 0일, 1일인 경우 결석 if(absence> N; cout
//https://www.acmicpc.net/problem/1010 #include using namespace std;int dp[31][31]; int main(){ int t; cin >> t; while(t-->0){ int n, m; cin >> n >> m; for(int i=1; i