题意:Q次操作,三维空间内 每个星星对应一个坐标,查询以(x1,y1,z1) (x2,y2,z2)为左下顶点 、右上顶点的立方体内的星星的个数。注意Q的范围为50000,显然离散化之后用三维BIT会MLE。 我们可以用一次CDQ把三维变成二维,变成二维之后就有很多做法了,树套树,不会树套树的话还可以...
分类:
编程语言 时间:
2014-12-09 21:09:12
阅读次数:
254
点击打开链接
Stars
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5140 Accepted Submission(s): 2020
Problem Description
Astr...
分类:
编程语言 时间:
2014-12-04 18:08:42
阅读次数:
214
题目StarsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 34016Accepted: 14839DescriptionAstronomers often examine star maps where stars are rep...
分类:
其他好文 时间:
2014-11-29 15:59:04
阅读次数:
219
StarsDescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the ...
分类:
其他好文 时间:
2014-11-27 12:06:58
阅读次数:
171
1、了解canvas
canvas id="stars" height="600">canvas>
这是画布
2、设置body背景色
style type="text/css">
body{
background-color: black;
}
style>
3、初始化画布及context...
分类:
Web程序 时间:
2014-11-23 20:18:54
阅读次数:
317
经典问题:二维偏序。给定平面中的n个点,求每个点左下方的点的个数。因为 所有点已经以y为第一关键字,x为第二关键字排好序,所以我们按读入顺序处理,仅仅需要计算x坐标小于树状数组。 1 #include 2 #include 3 #include 4 using namespace std; 5 st...
分类:
编程语言 时间:
2014-11-23 17:16:08
阅读次数:
244
树状数组:注意,这种大数据的题,千万别作死用cin我已经光荣的被T了一次了= =#include#include#includeusing namespace std;const int maxn=32005;int c[maxn],level[maxn],n;int lowbit(int x){ ...
分类:
其他好文 时间:
2014-11-17 17:23:24
阅读次数:
187
Stars
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 33786
Accepted: 14741
题目链接:http://poj.org/problem?id=2352
Description
Astronomers often examine star...
分类:
编程语言 时间:
2014-11-08 12:07:34
阅读次数:
265
StarsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 33344Accepted: 14560DescriptionAstronomers often examine star maps where stars are repre...
分类:
其他好文 时间:
2014-10-30 22:21:07
阅读次数:
182
这个题目刚开始没读懂,以为就是二维树状数组求上角矩阵和。
其实根本不用二维,因为数据已经有序,每次求的时候都是X方向上的比较。不过误打误撞也写了个离散化的代码。
WA:
#include
#include
#include
#include
#include
using namespace std;
#define N 15000
int c[N][N],n,mm;
int d[N];...
分类:
编程语言 时间:
2014-10-29 22:25:02
阅读次数:
295