摘要: 同http://www.cnblogs.com/ziyi--caolu/p/3202511.html#include#include#include#includeusing namespace std;struct node{ int x1,y1,x2,y2;}s[1100];int dp[1100],vist[1100][1100],n;int dfs(int num){ if(dp[num]>0) return dp[num]; dp[num]=1; for(int i=1;idp[num]) dp[num]=tmp; } } return dp[num];}int main(){ 阅读全文
posted @ 2013-07-20 16:19 紫忆 阅读(405) 评论(0) 推荐(0) 编辑
摘要: http://acm.nyist.net/JudgeOnline/problem.php?pid=16题意:有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a#include#include#includeusing namespace std;#define maxx 10000000struct node{ int x,y;}s[1100];int vist[1100][1100],n,dp[1100];int cmp(const node a,const node b){ if(a.x0) return dp[num]; dp[nu 阅读全文
posted @ 2013-07-20 15:36 紫忆 阅读(1736) 评论(0) 推荐(0) 编辑
摘要: http://acm.nbut.cn/Problem/view.xhtml?id=1475题意:给出一个数,需要你统计在这个数范围内有多少个1........思路:从高位到低位计算,例如1312最高位==1,说明最高位为一个的数字1000——1312,有313种次高位==3>1,那么先思考它本身为1的情况,只有三位数的时候,范围为1——312,其中第三位为1的情况有100种,在这情况下,如果有四位数,1——1312,第三位为1的情况,应该是它只有3位数的时候为1的情况加上有四位数时为1的情况,那么应该是200种次低位==1,同样的它只有两位的时候本身为1的情况只有3种(10,11,12) 阅读全文
posted @ 2013-07-20 13:52 紫忆 阅读(435) 评论(0) 推荐(0) 编辑