3581 分钟

用bitset的位操作来优化过程 但却不知道怎么普通的做,,,, #include<bitset> using namespace std; LL v,n,res; bitset<30000> dp; int main() { IN;OUT; v=io.xint(); n=io.xint(); dp.reset(); dp.set(0); f(i,0,n-1){ dp|=(dp<<io.xint()); } for
2.5k2 分钟

#include <iostream> using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double eln = 2.718281828459045235360287471352; #define f(i, a, b) for (int i = a; i <= b; i++) #define LL long long #define IN freopen(&qu
3.7k3 分钟

用bitset位操作代替逐个询问 而 已存在,只需 存在,就有 存在 而题意只需要价值存在即可 利用鬼谷子的钱包的分治思想优化解法 #include <cstdio> #include <bitset> using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double eln = 2.718281828459045235360287471352; #define f(i, a
9311 分钟

看了题解要分治,一开始打的代码有bug还不清楚什么情况 #include <cstdio> #include <algorithm> using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double eln = 2.718281828459045235360287471352; #define f(i, a, b) for (int i = a; i <=