2.7k2 分钟

有感觉了 两种不同公式的代码: #include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double
1.4k1 分钟

#include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double eln = 2.718
1.5k1 分钟

题意是要找出一个最小集合,使得从其中选取任意次数的元素之和等于或者大于。 容易发现一个可能解就是题目给定的集合,如果这不是一个解,那么答案就是无解。 接下来考虑的是如何缩减这个集合,显然如果有,那么就可以从解集中删除,而且容易发现不可能有某个元素仅由三个及以上的元素相加才可得,因为,那么必有。 所以我们只要一次NTT,直接卷自己即可。 #include <bits/stdc++.h> using namespace std; using ll=long long; const int mod=998244353; const int g=
1.7k2 分钟

#include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double eln = 2.718
1.9k2 分钟

预处理每个点所属块序号减少常数 #include <bits/stdc++.h> /* #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/hash_policy.hpp> */ using namespace std; const double eps = 1e-10; const double pi = 3.1415926535897932384626433832795; const double