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. HTML DOM setInterval() 方法

    定义和用法 setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式. setInterval() 方法会不停地调用函数,直到 clearInterval() 被调用或窗口被 ...

  2. Poi读取Excle报错 java.util.zip.ZipException: invalid stored block lengths

    一:Poi读取Excle报错  java.util.zip.ZipException: invalid stored block lengths 系统中需要导出excle签收单,excle模板是预设好 ...

  3. OpenStack之基础知识

    一.云计算 云计算(cloud computing)是基于互联网的相关服务的增加.使用和交付模式,通常涉及通过互联网来提供动态易扩展且经常是虚拟化的资源.云是网络.互联网的一种比喻说法.过去在图中往往 ...

  4. RESTful风格与RESTful Api

    REST(representational state transfer)(表述性状态转移),词汇解析: 1.representational 表述性:指资源以用各种形式来表述,包括 XML.JSON ...

  5. 20145303刘俊谦 《Java程序设计》实验四 实验报告

    实验要求 完成实验.撰写实验报告,实验报告以博客方式发表在博客园,注意实验报告重点是运行结果,遇到的问题(工具查找,安装,使用,程序的编辑,调试,运行等).解决办法(空洞的方法如"查网络&q ...

  6. 算法学习 - ST表 - 稀疏表 - 解决RMQ问题

    2017-08-26 21:44:45 writer:pprp RMQ问题就是区间最大最小值查询问题: 这个SparseTable算法构造一个表,F[i][j] 表示 区间[i, i + 2 ^ j ...

  7. 分析java进程假死状况

    摘自: http://www.myexception.cn/internet/2044496.html 分析java进程假死情况 1 引言 1.1 编写目的 为了方便大家以后发现进程假死的时候能够正常 ...

  8. Learning Perl 第六章习题第一题

    按照first name找last name 知识点: 1. hash的使用和初始化 2. 使用exists函数检测hash中的键是否存在

  9. byte字节数组的压缩

    写入内容到文件 public static void writeBytesToFile() throws IOException{ String s = "aaaaaaaaD等等" ...

  10. PHP中用下划线开头的含义

    命名的规则 加一个为私有的 加两个一般都是系统默认的,系统预定义的,即所谓:=====================“魔术方法”与“魔术常量”=====================★PHP起止为 ...