摘要: 题目:http://poj.org/problem?id=2528题意:有一面墙,被等分为1QW份,一份的宽度为一个单位宽度。现在往墙上贴N张海报,每张海报的宽度是任意的,但是必定是单位宽度的整数倍,且 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn = 10000+10; 7 int n, cnt; 8 int map[2*maxn][2], ans, f[2*maxn]; 9 struct node 10 { 11 int l, r, n; //n代表是哪种颜色... 阅读全文
posted @ 2014-02-18 19:59 水门 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=2352题意:给出n个星星的坐标, 每个星星的左下角有几个星星,该星星的level 就是几。求level为0~n-1的个数。本来想用线段树做,但是线段树还没理解好,做不出来, 就用树状数组做了。。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn = 32010; 7 int c[maxn], lev[15010]; 8 9 void init()10 {11 for(int i = 1; i 0)... 阅读全文
posted @ 2014-02-18 10:41 水门 阅读(143) 评论(0) 推荐(0) 编辑