typedef pair<int, int> pii; const db eps = 1e-8; const db pi = acos(-1);inline string add(string a, string b) { int f = 0; string ans = ""; if(b == "1") { for(int i = 1; i < a.size(); i ++) { b.push_back('0'); ...
typedeflonglongLL; typedef pair<int,int>PII;#definePI acos((double)-1)#defineE exp(double(1))#defineK 100000+9inta[K],vis[K],pos[K*10];intsz,n,m;doubleans[K*10],sum,num; map<int,int>p;structnode {intl,r,id; }q[K*10];intcmp(node ta,node tb) {if(pos[ta.l]==pos[tb...
typedefpair<int,int> pii; typedefpair<ll,ll> pll; ll read(ll x=0) { ll c, f(1); for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-f; for(;isdigit(c);c=getchar())x=x*10+c-0x30; returnf*x; } structGraph { intetot, head[maxn], to[maxe], next[maxe],...
dp[0][0] = 1;//初始化,一开始dp[0][0]就是是满足条件的。 for(int i = 1; i <= n; i++) { l = read(), r = read(); for(int j = l; j <= r; j++) { for(int k = 0; k + j * j < N; k++) dp[k + j * j][i] |= dp[k][i - 1];//开始暴力dp。 }...
typedeflonglongll; typedefunsignedlonglongull; typedefpair<ll,ll>PLL; typedefpair<int,int>PII; typedefpair<double,double>PDD; #define inlinellread() { llx=0,f=1; charch=getchar(); while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ...
#include<bits/stdc++.h>#define x first#define y secondusingnamespacestd;typedeflonglongll;typedef__int128i128;typedefpair<int,int>pii;constintN=2e5+10,mod=998244353;intb[N],a[N];constintB=31;structlinear_basis{intnum[B];intrank;voidclear(){rank=0;for(inti=0;i<B;i++)num[i]=0...
typedef pair<int, int> PII; // 区间合并 void merge(vector<PII> &segs) { if (segs.empty()) return; vector<PII> res; sort(segs.begin(), segs.end()); int st = segs[0].l, ed = segs[0].r; for (auto seg : segs) {
typedef pair<int,int>PII;constintN=2e5+10,INF=0x3f3f3f3f;int n,m,a[N];int color[N];int ans;struct Edge{int u,v;}edges[N];intcalc(int u){for(int i=1;i<=n;i++)color[i]=0;color[u]=1;// 染黑int res=a[u];for(int i=4;i<=n;i++){int u=edges[i].u,v=edges...
typedef vector<VPII> VVPII; typedef unordered_map<int,int> UMPII; typedef map<int,int> MPII; typedef set<int> SETI; typedef stack<int> STI; typedef queue<int> QI; typedef multiset<int> MSETI; typedef pair<long, long> PLL; ...
#include<bits/stdc++.h>#define maxn100010using namespace std;typedef pair<int,int>pii;typedef long long ll;#define ff first #define ss second #define mp make_pair vector<int>v[maxn];int vis[maxn];intmain(){int n,m;cin>>n>>m;for(int i=1;i<=m;i++){int x,y;cin>>x>>y...