import java.util.Scanner;
public class Main {public static void main(String[] args){Scanner scanner = new Scanner(System.in);int N = scanner.nextInt();int V = scanner.nextInt();int v[] = new int[N+1];int w[] = new int[N+1];int s[] = new int[N+1];for(int i=1;i<=N;i++){v[i] = scanner.nextInt();w[i] = scanner.nextInt();s[i] = scanner.nextInt();}int f[][] = new int[110][110];for(int i=1;i<=N;i++)for(int j=0;j<=V;j++)for(int k=0;k<=s[i]&&k*v[i]<=j;k++)f[i][j] = Math.max(f[i][j],f[i-1][j-k*v[i]]+k*w[i]);System.out.println(f[N][V]);}
}
1.快速幂
public static long qmi(long a, long b, long p) {long r 1;while (b ! 0) {if ((b & 1) 1) {r (r * a) % p;}b >> 1;a a * a % p;}return r;}
2.Java日期类
日期问题暂更
3.日期问题模板
考前更新
4.状态机DP
1.松散子序列 - 蓝桥云课 (lanqia…
REPORT zdemo_0006. *声明一个结构 DATA: BEGIN OF gs_alv, va1 TYPE char2, va2 TYPE char2, va3 TYPE char2, va4 TYPE char2, END OF gs_alv. *声明内表 DATA: gt_alv LIKE TABLE OF gs_alv. *赋值宏 DEFINE append_va. gs_alv-va1…