dp
混子本混
这个作者很懒,什么都没留下…
展开
-
B. Arpa‘s weak amphitheater and Mehrdad‘s valuable Hoses
B. Arpa’s weak amphitheater and Mehrdad’s valuable Hoses 并查集+ dp #include <bits/stdc++.h> using namespace std; const int N = 1010 ; int b[N] , w[N] , p[N] ,f[N]; int n , m, ww ; int x , y ; vector<int>ve[N] ; int find(int x ) { if(p[x] !=原创 2021-09-23 17:03:07 · 67 阅读 · 0 评论 -
D - Strange Lunchbox
D - Strange Lunchbox 链接 (好久不写dp题了,都快忘没了) 状态f[n][m] n为a的大小, m为b的大小,要求最小的个数 f[x][y] = f[x][y] = min(f[x][y] , f[max(0 , x - a[i])][max(0 , y - b[i] )] + 1 ) ; #include <bits/stdc++.h> using namespace std; const int N = 310; int a[N] , b[N] ; int f[N][原创 2021-09-23 16:58:30 · 126 阅读 · 0 评论