版本比较
题解:P13659 [CERC 2020] Storage Problems
正文
增加 2 行删除 2 行
12234567 行未改动1415161718181920212259 行未改动### P13659 [CERC 2020] Storage Problems 题解[洛谷传送门](https://www.luogu.com.cn/problem/P13659) [洛谷传送门](https://www.luogu.com.cn/problem/P13659)
#### 题目思路观察到对于 $i$ 和 $j$,需要计算不包含 $i$ 的大小为 $j$ 的子集,其总重量在区间 $[\max(0, k - w_i + 1), k]$ 内。因为如果子集的总重量在这个区间内,那么加入 $w_i$ 后就会超过 $k$。
7 行未改动
- 对于每个 $i,j$,答案 $ans_{i,j} = \sum_{s = \max(0, k - w_i + 1)}^{k} f_{j,s}$。
### Code> Talk is cheap,show me the code. > Talk is cheap,show me the code.> --- Linus Torvalds
``` cpp#include<bits/stdc++.h>59 行未改动