GSS4 - Can you answer these queries IV || luogu4145上帝造题的七分钟2 / 花神游历各国 GSS4 - Can you answer these queries IV 题目链接:https://www.luogu.org/problemnew/show/SP2713 线段树经典题目,然而被我用分块A了. 对于区间开根号,\(1e18\)最多会被开\(6\)次就会成为\(1\),成为\(1\)后,再开根号也是\(1\),0开根号也是0,线段树(分块…
#include<cstdio> #include<cmath> #include<iostream> #define M 100006 using namespace std; struct data { int l,r; long long zhi; bool kg; }shu[*M]; int n,m; void jian(int a1,int l,int r) { shu[a1].l=l; shu[a1].r=r; if(l==r) { scanf("…
#include<iostream> #include<cstdio> #include<cmath> using namespace std; ; struct node { int l,r; long long sum,maxx; }tree[maxn]; long long n; long long num[maxn]; long long pushup(long long x) { tree[x].sum=tree[x<<].sum+tree[x&l…
BZOJ3211花神游历各国 BZOJ luogu 分块 记一个all表示该块是否全部<=1,如果all不为真就暴力修改 因为一个数被开根的次数不多,即使\(10^{12}\)只要开根6次也会变成1,所以复杂度是可以证明的 注意BZOJ数据含0 #define ll long long #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int re(){ int x=0,w=1;char ch=getchar(…