摘要:
简单题#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)

浙公网安备 33010602011771号