![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
容斥
Miracle_QSH
这个作者很懒,什么都没留下…
展开
-
Gym - 101982B Coprime Integers(容斥原理)
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll ans, p = 0, maxx, a, b, c, d; ll prim[10000007],num[10000005]; void dfs(ll x, ll sum, ll num) { if(num > maxx)retur...原创 2018-11-30 16:46:50 · 483 阅读 · 0 评论 -
HDU - 2204 Eddy's爱好 (容斥原理)
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll prim[20] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61}; int main() { ll n, i, j, k, ans; while(scanf("%lld"...原创 2018-12-21 20:48:11 · 273 阅读 · 0 评论 -
HDU - 1796 How many integers can you find (容斥原理)
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n, m, a[15], ans, p; ll lcm(ll a, ll b){return a * b / __gcd(a, b);} void dfs(ll x, ll sum, ll num) { if(num > m)ret...原创 2018-12-21 20:49:14 · 166 阅读 · 0 评论 -
HDU - 2841 Visible Trees (容斥原理)
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll prim[100005], lenp = 0, isprim[100005] = {0}; ll data[100005], lend; ll n, m, t, ans; void getprim() { ll i, j, k; ...原创 2018-12-21 20:50:13 · 167 阅读 · 0 评论