设f[i][j]为第i分钟疲劳j,从三种情况转移,记得休息的时候判断从i开始休息到n能不能恢复到疲劳0 #include<iostream> #include<cstdio> using namespace std; const int N=10005,M=505; int n,m,a[N],f[N][M]; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf(&quo…
01背包... ----------------------------------------------------------------------- #include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #define rep( i , n ) for( int i = 0 ; i < n ; i++ ) #define clr( x , c )…
[Usaco2008 Jan] https://www.luogu.org/problemnew/show/P2419 题目描述 N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill ra…