HDU - 1166 敌兵布阵 (树状数组模板题/线段树模板题)
①树状数组
#include<bits/stdc++.h>
using namespace std;
int n;
int c[50010];
int lowbit(int x)
{
return x & -x;
}
void add(int i,int val)// Add操作,将第i个元素增加val,那么他的父节点也要增加+
{
while(i<...
原创
2018-09-14 14:25:56 ·
165 阅读 ·
0 评论