萌新求助宏定义
  • 板块学术版
  • 楼主Dunkerque
  • 当前回复5
  • 已保存回复5
  • 发布时间2021/7/31 21:46
  • 上次更新2023/11/4 12:21:36
查看原帖
萌新求助宏定义
120028
Dunkerque楼主2021/7/31 21:46

RT,

void pushdown(int p,int l,int r){
	int len=r-l+1;
	tag[lson]+=tag[p];
	tag[rson]+=tag[p];
	tree[lson]+=tag[p]*(len-(len/2));
	tree[rson]+=tag[p]*(len/2);
	tag[p]=0;
}
#define len r-l+1
void pushdown(int p,int l,int r){
	tag[lson]+=tag[p];
	tag[rson]+=tag[p];
	tree[lson]+=tag[p]*(len-(len/2));
	tree[rson]+=tag[p]*(len/2);
	tag[p]=0;
}

这两个程序有什么区别吗?

2021/7/31 21:46
加载中...