上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 182 下一页
摘要: 几何公式#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define pi acos(-1)int D, V;int main(){ while (scanf("%d%d", &D, &V), D | V) { printf("%.3f\n", pow(D * D * D - 6 * V / pi, 1.0 / 阅读全文
posted @ 2013-06-07 16:38 undefined2024 阅读(164) 评论(0) 推荐(0)
摘要: 题意:n<=10000,并保证存在n的某个倍数的十进制表示形式各个数位都为1。问这个数是n的多少倍。分析:我们枚举1,11,111……直到找到能被n整除的为止。为了防止这个1序列过大,我们不断将其对n取余,这样可以保证其一直在int范围内,并且不影响整除性。#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;int n;int main(){ while (scanf("%d", & 阅读全文
posted @ 2013-06-07 16:16 undefined2024 阅读(287) 评论(0) 推荐(0)
摘要: 简单题#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 3005int n;bool vis[maxn];bool ok(int a){ if (a < 0) a = -a; if (a >= n || a < 1) return false; if (vis[a]) return false; vis[a] = true; return true;}bool wo... 阅读全文
posted @ 2013-06-02 19:33 undefined2024 阅读(250) 评论(0) 推荐(0)
摘要: 简单题#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define pi 3.1415927int revolution;double travel_time, diameter;int main(){ int t = 0; while (scanf("%lf%d%lf", &diameter, &revolution, &travel_time), revoluti 阅读全文
posted @ 2013-06-02 19:17 undefined2024 阅读(121) 评论(0) 推荐(0)
摘要: 题意:有n个长度为len的模式串,问在所有长度为L的串中有多少个串符合如下条件:该串所有长度为len的子串都在这n个模式串中。分析:动态规划,f[i][j]表示长度为i的以第j个模式串为后缀的符合条件的串有多少个,f[i + 1][k] += f[i][j];k要符合第k个模式串可以由第j个模式串去掉首字母,再在结尾添加一个字母得到。就相当于我们不断的将模式串有重叠地(重叠长度为len-1)搭在当前构成的长度为i的串的结尾,使长度变为i+1。也就是第k个模式串就是长度为i+1的串比长度为i的串多出的那个长度为len的子串(长度为i+1的串的长度为len的子串个数只比长度为i的串的长度为len的 阅读全文
posted @ 2013-06-02 17:00 undefined2024 阅读(216) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 182 下一页