上一页 1 2 3 4 5 6 7 8 ··· 25 下一页
摘要: 题解:dp[i][j]表示长度为i,匹配了j个的方案数,压缩成矩阵,转移即可。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <algorithm> 6 7 #define SIZE 21 8 9 using namespace std; 10 11 struct MT 12 { 13 int x,y; 14 int mt[SIZE][SIZE]; 15 void prt() 阅读全文
posted @ 2013-03-05 21:00 proverbs 阅读(1462) 评论(0) 推荐(0) 编辑
摘要: 题解:维护一个栈就好了,画画图就知道怎么维护了。。这两天总写不对计算几何的水题。。真是郁闷。。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <algorithm> 6 7 #define N 555555 8 #define EPS 1e-7 9 10 using namespace std; 11 12 struct PO 13 { 14 double x,y; 15 v 阅读全文
posted @ 2013-03-03 22:39 proverbs 阅读(947) 评论(2) 推荐(0) 编辑
摘要: 题解:区间总的方案数是可以算的,只要求相同的颜色的方案数即可。(数学中讲的古典概型??)我不知道我写的是不是莫队算法,时间还是很快的。。话说,这题稍微优化的暴力也能过。看了别人的介绍莫队算法的文章没有看太懂,也不知道这个神奇的复杂度是怎么证明的。。。我大致是这样做的:1、分块2、把所有询问左端点排序3、对于左端点在同一块内的询问按右端点排序,然后分三种情况统计。传说中这样复杂度是nsqrt(n)的,但是我怎么觉得这个和我的暴力差不多。。。。莫名其妙跑的这么快。。。View Code 1 #include <iostream> 2 #include <cstring> 3 阅读全文
posted @ 2013-03-03 20:48 proverbs 阅读(2522) 评论(0) 推荐(0) 编辑
摘要: 从这里看到的这个题。。很容易想到正解。http://blog.csdn.net/zxy_snow/article/details/6739561思路大概一样,就是不知道为什么我被卡精度了,,,acos精度本来就不好,然后题目还要求输出百分比+五位小数,直接把精度卡了。反正我写出来的当半径很大的时候误差会非常大,会达到3%左右。哎,查了一个下午,用几何画板模拟。真是恶心死了!我早知道卡精度就不做了。不知道“小媛”姐姐是怎么做的,实在不想看这个题了。感觉我的思维和代码都是挺清晰的。。尽管wa了,还是贴出来吧。。View Code 1 #include <cstdio> 2 #inclu 阅读全文
posted @ 2013-03-02 19:43 proverbs 阅读(577) 评论(0) 推荐(0) 编辑
摘要: 题解:投在地上的影子是很多圆和两圆公切线组成的梯形的面积并。PS:圆只要和地面平行,无论光从哪个角度照射,投影都是圆其实应该一开始应先分成若干份做simpson的。。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 520 9 #define EPS 1e-610 11 usi 阅读全文
posted @ 2013-03-02 19:36 proverbs 阅读(870) 评论(0) 推荐(0) 编辑
摘要: 题意:给出一些建筑物的高度与宽度,求出一条最矮的抛物线运动轨迹,能够跨过所有的建筑物。输出初速度与水平方向的夹角,以及初速度的大小。重力加速度取9.8m/(s^2)题解:相当于知道抛物线两点,求最小高度,二分抛物线方程的参量,然后检查所有建筑的顶点和抛物线的高度。再次没有写。。。。 阅读全文
posted @ 2013-02-28 23:53 proverbs 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题意:给你两个集合的点,让你求一条线把这些点分成两部分,使得每一部分都包含每个集合点的一半。题解:继续通过没据点来枚举半平面~用那个多添加n-1个元素的方法,写起来真是无脑~View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 33333 9 #define EPS 1e-710 阅读全文
posted @ 2013-02-28 23:51 proverbs 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 球面距离公式:dis = acos(sin(p1y) * sin(p2y) + cos(p1y) * cos(p2y) * cos(p2x - p1x)) * R;其中p1y,p2y表示维度(北正南负),p1x,p1y表示经度(东正西负)。R为球的半径 阅读全文
posted @ 2013-02-28 23:42 proverbs 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 题意:一些点,求一个单位圆最多能覆盖的点的个数,不存在两点距离恰好为2.题解:暴力枚举两个点,求圆心,然后枚举每个点验证是否在圆内。n^3的,可以过~当然还有n^2logn的转化为求圆的最大弧的覆盖次数问题(以后做CIRU 的时候也会用到这个技术~)n^3View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 #include <algorithm> 6 #include <cmath> 阅读全文
posted @ 2013-02-28 23:40 proverbs 阅读(1228) 评论(0) 推荐(0) 编辑
摘要: 题意:求从光源透过圆形的阴影的线段,并排序输出。题解:求圆的切线,利用勾股定理和坐标旋转即可。处理出所有与地平线的交点,标号正负1,排序,然后扫一遍就好了~View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 2222 9 #define BUG system("paus 阅读全文
posted @ 2013-02-28 23:32 proverbs 阅读(243) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 25 下一页