版本比较
容斥原理及其简单例题
正文
增加 7 行删除 7 行
27 行未改动282930313232333435362 行未改动3940414243434445464747 行未改动95969798999910010110210342 行未改动1461471481491501501511521531543 行未改动1581591601611621621631641651668 行未改动1751761771781791791801811821839 行未改动19319419519619719719819920020127 行未改动#include <algorithm>#include <vector>#include <queue>#include <stack>#define ll long long #define ll long long#define N 21using namespace std;int n;ll ans = 0;2 行未改动 node(int _x = 0, int _y = 0, int _l = 0){ x = _x; y = _y; l = _l; } ll area(){//求面积
if(l < 0) return 0; else return ((ll)l * (ll)l) >> 1; }} data[N];47 行未改动#include <cstring>#include <cmath>#include <algorithm>#define N 50005#define ll long long #define ll long long#define un unsignedusing namespace std;ll prime[N];ll n, m;42 行未改动#include <iostream>#include <cstdio>#include <algorithm>using namespace std;#define ll long long #define ll long long#define N 4005ll luck[N], luck_num;ll luc[N], cnt;ll a, b, ans = 0, now;3 行未改动}
inline void fi(ll r,ll numb){ if(numb > r) return ; if(numb) luck[++luck_num] = numb; if(numb) luck[++luck_num] = numb; fi(r, numb * 10 + 6); fi(r, numb * 10 + 8);}inline void dfs(ll x, ll p){8 行未改动 ll befor = now; now = now / gcd_(now, luc[x]); if((double)now * luc[x] <= b){ now *= luc[x]; dfs(x + 1, p + 1); dfs(x + 1, p + 1); } now = befor;}int main(){9 行未改动 } reverse(luc + 1, luc + 1 + cnt); now = 1; dfs(1, 0); printf("%lld", ans); printf("%lld", ans); return 0;}
```