上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 182 下一页
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <cmath>using namespace std;int n;int f[] ={ 3, 5, 8, 12, 20, 34, 57, 98, 170, 300, 536, 966, 1754, 3210, 5910, 10944, 20366, 38064, 71421, 134480, 254016};int main(){ //freopen 阅读全文
posted @ 2011-10-05 16:53 undefined2024 阅读(250) 评论(0) 推荐(0)
摘要: 题意:这题的本质是给定若干条边,问能否用其中的一些组成多边形。分析:先排序,看前i个的和是否大于第i+1个,若大于则可以View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <algorithm>using namespace std;#define maxn 30double f[maxn];int n;void input(){ for (int i = 0; i < n; i++) scanf(& 阅读全文
posted @ 2011-10-05 16:13 undefined2024 阅读(231) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;#define maxl 1005#define maxn 30int f[maxn], g[maxn];char a[maxl], b[maxl];void make(char *st, int f[]){ int len = strlen(st); for (int i = 0; i < len; i++) f[st[i] - & 阅读全文
posted @ 2011-10-03 17:56 undefined2024 阅读(207) 评论(0) 推荐(0)
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;struct Point{ double x, y;} point[5];void input(){ for (int i = 1; i < 4; i++) scanf("%lf%lf", &point[i].x, &point[i].y); if (point[1].x != point[2].x 阅读全文
posted @ 2011-10-03 17:37 undefined2024 阅读(176) 评论(0) 推荐(0)
摘要: 题意:给出p,q,r,s,求c(p,q)/c(r,s)分析:利用组合数公式,写出整体的分子和分母(用数组标记,分子分母各有哪些数),把相同的数字约去。然后把分子乘上,分母除掉。但是这样直接乘除会损失精度。所以我们定义double ans = 1;然后当ans<1时算乘法,ans>=1时算除法,以控制ans始终在1不会和1相差10000倍以上,以保证精度。View Code #include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using name 阅读全文
posted @ 2011-10-03 15:15 undefined2024 阅读(159) 评论(0) 推荐(0)
上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 182 下一页