180126_2616_소형기관차
//https://www.acmicpc.net/problem/2616#include #include using namespace std;int dp[4][50001];int train[50001]; int main(){ int n,m; cin >> n; for(int i=1; i> x; train[i]=train[i-1]+x; } cin >> m; for(int i=1*m; i
//https://www.acmicpc.net/problem/2616#include #include using namespace std;int dp[4][50001];int train[50001]; int main(){ int n,m; cin >> n; for(int i=1; i> x; train[i]=train[i-1]+x; } cin >> m; for(int i=1*m; i
//https://www.acmicpc.net/problem/1328#include #define MOD 1000000007using namespace std;long long dp[101][101][101]; int main(){ int n, l, r; long long temp; cin >> n >> l >> r; dp[1][1][1]=1; dp[2][1][2]=dp[2][2][1]=1; for(int i=3; i
//https://www.acmicpc.net/problem/10835#include #include #include #include using namespace std;int dp[2001][2001]; // dp[x][y] : 왼쪽카드x번째, 오른쪽카드 y번째일 때, 앞으로 얻을 수 있는 점수 최대값int lc[2001]; // left cardint rc[2001]; // right cardint n; int play(int x, int y){ if(x==n+1 || y==n+1) return 0;// 둘 중 하나가 더이상 카드가 없으면 앞으로 얻을 점수 0 if(dp[x][y] != -1) return dp[x][y]; // 이미 계산한 것은 나와야함 // 앞으로 얻을 점수이므로 앞에서와는 무관하..
//https://www.acmicpc.net/problem/10942#include #include using namespace std;int num[2001];bool dp[2001][2001]; int main() { int n, m; int start, end; scanf("%d",&n); for(int i=1; i