摘要: http://poj.org/problem?id=1159这题以前见过 不会 今天做比赛又看到 知道自己不会 就没多想 后来CZ说是水题 最长公共子序列 我就开始想想到求正序和逆序的最长公共子序列 不知道对不对 就自己想了几个数据试了一下 都过了 就交了 还真蒙对了 ME了一次 又现学的滚动数组View Code 1 #include <iostream> 2 #include<cstdio> 3 using namespace std; 4 int dp[3][5001]; 5 int main() 6 { 7 int i = 0,j = 0,k,n; 8 char 阅读全文
posted @ 2012-08-18 17:51 _雨 阅读(257) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1328以每个点为圆心 d为半径 画圆 记录与x轴交出的区间 就变成区间覆盖的问题了 贪心若区间有重叠 区间重叠的地方放一个雷达就可以覆盖这几个区间的点了把该换成double 的数都换成double 这里WA了n次啊View Code 1 #include<stdio.h> 2 #include<iostream> 3 #include<algorithm> 4 #include<cmath> 5 using namespace std; 6 struct node 7 { 8 double d 阅读全文
posted @ 2012-08-18 17:45 _雨 阅读(207) 评论(0) 推荐(0) 编辑
摘要: A. Mountain Scenerytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Bolek has found a picture with n mountain peaks painted on it. The n painted peaks are represented by a non-closed polyline, consisting of 2n segments. The segments go thro 阅读全文
posted @ 2012-08-18 17:40 _雨 阅读(345) 评论(0) 推荐(0) 编辑