博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hdu5032 极角排序+树状数组
阅读量:7259 次
发布时间:2019-06-29

本文共 680 字,大约阅读时间需要 2 分钟。

思路:参考了题解。对询问进行极角排序,然后用树状数组维护一下前缀和即可。

/*ID: onlyazh1LANG: C++TASK: test*/#include
using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1typedef long long ll;const int maxn=1010;const int maxm=100050;ll sum[maxn];struct Node{ int x,y; int loc,id; bool operator< (const Node &A)const{ return y*1.0/x
0){ ret+=sum[x]; x-=lowbit(x); } return ret;}int hi[maxn];ll ans[maxm];int main(){ //ifstream cin("in.txt"); int T,icase=0;scanf("%d",&T); while(T--){ for(int i=0;i
>q; for(int i=0;i
View Code

 

转载于:https://www.cnblogs.com/onlyAzha/p/5518011.html

你可能感兴趣的文章