上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 52 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2992 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 200 7 #include 8 using namespace std; 9 10 const int inf=0x3fffffff; 11 12 struct node 13 { 14 int v,cost; 15 }; 16 int g[maxn][maxn],a[maxn],dis[20000]; 17 int n... 阅读全文
posted @ 2014-03-30 17:03 null1019 阅读(171) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1353 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int dp[10][82]; 7 void inti() 8 { 9 memset(dp,0,sizeof(dp));10 dp[0][0]=1;11 for(int i=1; i=0)18 dp[i][j]+=dp[i-1][j-k];19 }20 }21 }22... 阅读全文
posted @ 2014-03-28 19:07 null1019 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1203 1 #include 2 #include 3 #include 4 #define maxn 400000 5 using namespace std; 6 7 struct node 8 { 9 int s,e;10 bool operator a.s));13 }14 }p[maxn];15 int dp[maxn];16 17 int main()18 {19 int n;20 scanf("%d",&n);21 for(int i... 阅读全文
posted @ 2014-03-28 16:50 null1019 阅读(143) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1146 1 #include 2 #include 3 #include 4 #define maxn 200 5 using namespace std; 6 7 const int inf=0x7fffffff; 8 int dp[maxn][maxn],a[maxn][maxn]; 9 10 int main()11 {12 int n;13 scanf("%d",&n);14 for(int i=1; i<=n; i++)15 {16 dp... 阅读全文
posted @ 2014-03-27 21:11 null1019 阅读(147) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1019 1 #include 2 #include 3 #include 4 #define maxn 200100 5 using namespace std; 6 7 struct node 8 { 9 int r,l,co; 10 }tree[maxn*4]; 11 int co[maxn],l[maxn],r[maxn]; 12 struct node1 13 { 14 int x,y,co; 15 }p[maxn*4]; 16 17 void bui... 阅读全文
posted @ 2014-03-26 19:04 null1019 阅读(164) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1246 1 #include 2 #include 3 #include 4 #define maxn 200010 5 using namespace std; 6 7 struct node 8 { 9 double x,y;10 }p[maxn];11 12 double cross(node a,node b,node c)13 {14 return (c.x-a.x)*(b.y-a.y)-(c.y-a.y)*(b.x-a.x);15 }16 17 int main()1... 阅读全文
posted @ 2014-03-25 19:25 null1019 阅读(196) 评论(0) 推荐(0) 编辑
摘要: http://acm.timus.ru/problem.aspx?space=1&num=1119 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 1010 7 using namespace std; 8 9 int head[maxn],e,n,m;10 int dir[4][2]={{0,-1},{0,1},{1,0},{-1,0}};11 bool vis[maxn][maxn];12 bool visi[maxn][maxn];13 double step;14 15 struct.. 阅读全文
posted @ 2014-03-24 21:01 null1019 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const double eps=1e-8; 7 8 int main() 9 {10 double a,b,c,d;11 scanf("%lf%lf%lf%lf",&a,&b,&c,&d);12 a*=1000.0; b*=1000.0; c*=1000.0; d*=1000.0;13 if(fabs(c*d-a*b)<eps)14 {15 printf("Impossible.\n&qu 阅读全文
posted @ 2014-03-24 19:43 null1019 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #define maxn 20000 6 using namespace std; 7 const double eps=1e-8; 8 9 inline double sqr(double x)10 {11 return x*x;12 }13 inline int dcmp(double x)14 {15 if(fabs(x)eps)43 {44 return false;45 }46 }47 retu... 阅读全文
posted @ 2014-03-22 23:21 null1019 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #define maxn 200 5 using namespace std; 6 7 double x[maxn],y[maxn],r[maxn]; 8 9 double sqr(double x)10 {11 return x*x;12 }13 14 int main()15 {16 int t;17 scanf("%d",&t);18 for(int i=0; i<t; i++)19 {20 scanf("%lf%lf%lf",&x[i],&y[i] 阅读全文
posted @ 2014-03-22 21:19 null1019 阅读(105) 评论(0) 推荐(0) 编辑
上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 52 下一页