hdu 2642 Stars】的更多相关文章

Problem Description Yifenfei is a romantic guy and he likes to count the stars in the sky. To make the problem easier,we considerate the sky is a two-dimension plane.Sometimes the star will be bright and sometimes the star will be dim.At first,there…
题目 题目大意:Yifenfei是一个浪漫的人,他喜欢数天上的星星.为了使问题变得更容易,我们假设天空是一个二维平面,上面的星星有时会亮,有时会发暗.最开始,没有明亮的星星在天空中,然后将给出一些信息,"B XY",其中"B"代表明亮,x代表X坐标和Y代表Y坐标是指在(X,Y)的明星是光明的,而在"D XY"'D'的意思是灰暗的星星在(X , Y).当得到"Q X1 X2 Y1 Y2"的查询,你应该告诉Yifenfei在该地区…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1541 思路:要求求出不同等级的星星的个数,开始怎么也想不到用树状数组,看完某些大神的博客之后才用树状数组写的,搞了好久才懂得数组的更新过程 #include<cstdio> #include<iostream> #include<algorithm> #include<math.h> #include<string.h> #include<ve…
Stars Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 41521   Accepted: 18100 Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a st…
Stars Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/65536 K (Java/Others) Total Submission(s): 785    Accepted Submission(s): 335 Problem Description Yifenfei is a romantic guy and he likes to count the stars in the sky. To make the p…
Problem Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given…
一開始想,总感觉是DP,但是最后什么都没想到.还暴力的交了一发. 然后開始写线段树,结果超时.感觉自己线段树的写法有问题.改天再写.先把树状数组的写法贴出来吧. ~~~~~~~~~~~~~~~~~~~~~~~~ 树状数组不懂的去看刘汝佳的大白书,那个图画得非常清楚. 题目大意:星星的坐标以y递增的顺序给出,这些点的左下方的点数代表这个点的级数,问0~N-1的级数有多少个?事实上y根本木实用. 题目链接:http://poj.org/problem?id=2352 http://acm.hdu.e…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5126 思路:支持离线,那么我们可以用两次CDQ分治使四维降为二维,降成二维后排个序用树状数组维护下就好了 实现代码: #include<bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; ; int ans[M],c[M]; struct node { int x,y,z; int kind,id; node(){} no…
 Problem Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the giv…
Time Limit: 1000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 930    Accepted Submission(s): 200 Problem Description Can you believe it? After Gardon had solved the problem, Angel accepted him! They were sitt…