void dandiao() {
int front=,tail=;
for (int a=;a<=k;a++)
{
while (tail>=front && z[a]<q[tail][])
tail--;
tail++;
q[tail][]=z[a];q[tail][]=a;
} for (int a=k+;a<=n;a++)
{
while (tail>=front && z[a]<q[tail][])
tail--;
tail++;
q[tail][]=z[a];q[tail][]=a;
if (q[front][]==a-k) front++;
}
} class queue {
int front=,tail=,q[];
void enque(int x) { q[++tail]=x;}
void deque() { front++;}
bool empty() { return front>tail;}
int front1() { return q[front];
}
class stack {
int size=,s[];
void enque(int x) { s[++size]=x;}
void deque() { size--;}
bool empty() { return size!=;}
int front() { return s[size];
} #include<queue> using namespace std; priority_queue<int> heap; heap.push(-x);//logn
heap.pop();//logn
heap.top();//
heap.size();//
heap.empty();// struct rec {
int a;
bool operator<(const rec &not_gg)const {
return a<not_gg.a;
}
}a,b,z[]; sort(z,z+n); bool operator<(const rec &gg1,const rec &gg2){
return gg1.a<gg2.a;
} priority_queue<rec> heap; int getf(int p) {
if (f[p]==p) return p;
else return f[p]=getf(f[p]);
} void merge(int p1,int p2) {
int f1=getf(p1);
int f2=getf(p2);
if (f1!=f2) {
if (size[f1]>size[f2]) swap(f1,f2);
f[f1]=f2;
size[f2]+=size[f1];
}
} west14.openjudge.cn/ const int maxn=;
int z[maxn],sum[maxn<<];//maxn*4 //rt <<1 =rt*2
//rt<<1|1=rt*2+1 #define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1 void update(int rt) {
sum[rt]= sum[rt<<] + sum[rt<<|];
} void build(int l,int r,int rt) {
if (l==r) {
sum[rt]=z[l];
return;
}
int m=(l+r)>>;//(l+r)/2 [l,m] [m+1,r]
build(lson);
build(rson);
update(rt);
}
build(,n,); int query(int l,int r,int rt,int nowl,int nowr) {
if (nowl<=l && r<=nowr) return sum[rt];
int m=(l+r)>>;
int ans=;
if (nowl<=m) ans+=query(lson,nowl,nowr);
if (m<nowr) ans+=query(rson,nowl,nowr);
return ans;
}
query(,n,,l,r); void modify(int l,int r,int rt,int p,int v) {
if (l==r) {
sum[rt]=v;
return;
}
int m=(l+r)>>;
if (p<=m) modify(lson,p,v);
else modify(rson,p,v);
update(rt);
}
modify(,n,,p,v);
忠诚 const int maxn=;
int z[maxn],sum[maxn<<];//maxn*4 //rt <<1 =rt*2
//rt<<1|1=rt*2+1 #define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1 void update(int rt) {
sum[rt]= sum[rt<<] + sum[rt<<|];
} void color(int l,int r,int rt,int c) {
col[rt] = c;
sum[rt] = c*(r-l+);
} void push_col(int l,int r,int rt) {
if (col[rt]) {
int m=(l+r)>>;
color(lson,col[rt]);
color(rson,col[rt]);
col[rt]=;
}
} void build(int l,int r,int rt) {
col[rt]=;
if (l==r) {
sum[rt]=z[l];
return;
}
int m=(l+r)>>;//(l+r)/2 [l,m] [m+1,r]
build(lson);
build(rson);
update(rt);
}
build(,n,); int query(int l,int r,int rt,int nowl,int nowr) {
if (nowl<=l && r<=nowr) return sum[rt];
push_col(l,r,rt);
int m=(l+r)>>;
int ans=;
if (nowl<=m) ans+=query(lson,nowl,nowr);
if (m<nowr) ans+=query(rson,nowl,nowr);
return ans;
}
query(,n,,l,r); void modify(int l,int r,int rt,int nowl,int nowr,int v) {
if (nowl<=l && r<=nowr) {
color(l,r,rt,v);
return;
}
push_col(l,r,rt);
int m=(l+r)>>;
if (nowl<=m) modify(lson,nowl,nowr,v);
if (m<nowr) modify(rson,nowl,nowr,v);
update(rt);
}
modify(,n,,l,r,v); notonlysuccess.com
notonlysuccess while (scanf("%s%s",gg1,gg2) != EOF) {
} scanf("%dgg%d",&a,&b);
scanf("%d-%d-%d %d:%d:%d",&year,&month,&day,&hour,&minute,&second); #ifdef WIN32
#define LL "%I64d"
#else
#define LL "%lld"
#endif int x;scanf("%d",&x);
long long x;scanf(LL,&x);
double x;scanf("%lf",&x);
char x[];scanf("%s",x);
scanf("%s",x+);
char x;scanf("%c",&x); scanf("%d" LL,&x,&y); printf("%.8lf\n",x);
printf("% 8d\n",x);
scanf("%d\n%d",&x,&y); string; int y[];
int *z=y+;
z[-] y[];

zhx'code1的更多相关文章

  1. zhx and contest (枚举  + dfs)

    zhx and contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  2. zhx's contest (矩阵快速幂 + 数学推论)

    zhx's contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) To ...

  3. HDU - 5187 - zhx&#39;s contest (高速幂+高速乘)

    zhx's contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) To ...

  4. mysql 安装过程中的错误:my-template.ini could not be processed and written to XXX\my.ini.Error code-1

    安装mysql的过程中,在最后配置mysql时,提示错误:Configuration file tmeplate E:\编程\MySQL\my-template.ini could not be pr ...

  5. HDOJ 5188 zhx and contest 贪婪+01背包

    zhx and contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  6. HDU - 5186 - zhx&#39;s submissions (精密塔尔苏斯)

    zhx's submissions Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others ...

  7. HDU 5186 zhx&#39;s submissions (进制转换)

    Problem Description As one of the most powerful brushes, zhx submits a lot of code on many oj and mo ...

  8. 【HDU5187】zhx's contest

    [问题描述] 作为史上最强的刷子之一,zhx的老师让他给学弟(mei)们出n道题.zhx认为第i道题的难度就是i.他想要让这些题目排列起来很漂亮. zhx认为一个漂亮的序列{ai}下列两个条件均需满足 ...

  9. HDU5187 zhx's contest

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission ...

随机推荐

  1. mysql中sql语句中常见的group_concat()函数意思以及用法,oracle中与其一样的功能函数是wmsys.wm_concat()

    1.group_concat(),手册上说明:该函数返回带有来自一个组的连接的非NULL值的字符串结果.比较抽象,难以理解. 通俗点理解,其实是这样的:group_concat()会计算哪些行属于同一 ...

  2. STM32 HAL库详解 及 手动移植

    源: STM32 HAL库详解 及 手动移植

  3. PHP秒杀系统全方位设计分析(二)

    商品页面开发 静态化展示页面[效率要比动态PHP高很多,PHP程序需要解析等步骤,本身就需要很多流程,整个下来PHP的处理花的时间和资源要多] 商品状态的控制 开始前.进行中.库存不足.结束 数据逻辑 ...

  4. 第三方CSS安全吗?

    原文:https://jakearchibald.com/201...翻译:疯狂的技术宅 本文首发微信公众号:jingchengyideng欢迎关注,每天都给你推送新鲜的前端技术文章 前一段时间,有很 ...

  5. Vue数据绑定失效

    首先,我们得明白Vue数据响应的原理: 以对象为例:当把一个JavaScript对象传给Vue实例的data选项时,Vue将遍历此对象所有的属性,并使用Object.defineProperty把这些 ...

  6. 如何打开windows的远程桌面

    WINDOWS 2003/XP 系列设置方法 右键点击[我的电脑]选择[属性],进入[系统属性]界面,点击[远程]选项卡,勾选[启用这台计算机上的远程桌面]即可. 2003/XP系统默认只允许计算机a ...

  7. 管理账号密码的工具-KeePass使用方法

    附件链接:https://files.cnblogs.com/files/stxs/KeePass.zip 打开压缩包“KeePass.zip",将文件"KeePass.exe&q ...

  8. BZOJ4765: 普通计算姬

    BZOJ4765: 普通计算姬 题目描述 传送门 题目分析 求的和非常奇怪,不具有连续性,所有上树的数据结构全死了. 考虑分块,思考对于一段连续的询问区间可以直接询问整块,零散块可以在树上dfs序暴力 ...

  9. Spring的配置相关知识(学习spring boot的预备知识)

    我们经常说的控制反转(Inversion of Control-IOC)和依赖注入(dependency injection-DI)在Spring环境下是等同的概念,控制反转是通过依赖注入实现的.所谓 ...

  10. java如何实现Socket的长连接和短连接

    讨论Socket必讨论长连接和短连接 一.长连接和短连接的概念 1.长连接与短连接的概念:前者是整个通讯过程,客户端和服务端只用一个Socket对象,长期保持Socket的连接:后者是每次请求,都新建 ...