传送门 f[i][j][k][l]f[i][j][k][l]f[i][j][k][l]表示用iii张111,jjj张222,kkk张333,lll张444能凑出的最大贡献. 然后从f[i−1][j][k][l],f[i][j−1][k][l],f[i][j][k−1][l],f[i][j][k][l−1]f[i-1][j][k][l],f[i][j-1][k][l],f[i][j][k-1][l],f[i][j][k][l-1]f[i−1][j][k][l],f[i][j−1][k][l],f[…