想到两点就行:
1、相邻项相减,处理出相对高度,这样如果pattern或者text增加的话,就没问题了
2、KMP匹配O(n)
HASH的话 ,我WA在第25组数据了,听说如果改为大素数取模就能AC
KMP AC了 但是好奇怪我的KMP模板难道有问题??
先贴KMP ac 代码
//#pragma comment(linker, "/STACK:102400000,102400...
分类:
其他好文 时间:
2014-10-02 17:02:23
阅读次数:
308
题目地址:POJ 1988
这道题的查找合并的方法都能想的到,就是一点没想到,我一直天真的以为查询的时候,输入后能马上输出,这样的话在合并的时候就要所有的结点值都要算出来,但是经过路径压缩之后,没办法全部都处理到,如果不压缩妥妥的TLE。。于是看了看网上的题解。才发现自己是多么的天真(ben,四声)。。在查询的时候只要找一次跟就可以了。。这样不需查询的也就没必要处理出来。反而更省时。...
分类:
其他好文 时间:
2014-10-02 00:02:01
阅读次数:
279
D -MUH and Cube WallsTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 471DDescriptionPolar bears Mens...
分类:
其他好文 时间:
2014-10-01 11:38:41
阅读次数:
241
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5053解题报告:用来陶冶情操的题,求a到b的三次方的和。 1 #include 2 #include 3 #define INT __int64 4 int main() 5 { 6 int T,...
分类:
其他好文 时间:
2014-09-29 19:40:11
阅读次数:
217
http://acm.hdu.edu.cn/showproblem.php?pid=5053题目大意: 求出A^3+(A+1)^3+(A+2)^3+...+B^3和是多少解题思路: 设f(n)=1~n的立方和,则A^3+(A+1)^3+(A+2)^3+...+B^3=f(B) - f(A - 1.....
分类:
其他好文 时间:
2014-09-29 16:25:43
阅读次数:
185
开篇介绍大多数情况下我们的 SSIS 包都会配置在 SQL Agent Job 中周期性的按计划执行,比如每天晚上调用 SSIS 包刷新数据,处理 Cube 等。一旦 SSIS 包中出现任何异常,报错,那么配置在 SQL Agent Job 中的通知,邮件提醒就会把这些错误信息发邮件到指定的用户或者...
HDU5053the Sum of Cube(水题)
题目链接
题目大意:给你L到N的范围,要求你求这个范围内的所有整数的立方和。
解题思路:注意不要用int的数相乘赋值给longlong的数,会溢出。
代码:
#include
#include
const int N = 10005;
typedef long long ll;
ll t[N];
void ...
分类:
其他好文 时间:
2014-09-28 21:30:25
阅读次数:
164
the Sum of Cube
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 405 Accepted Submission(s): 224
Problem Description
A range is g...
分类:
其他好文 时间:
2014-09-28 18:03:45
阅读次数:
135
题意 求给定区间[a,b] 所有整数的立方和 0
注意10000^3会爆int
#include
using namespace std;
typedef long long ll;
int main()
{
int cas;
ll a, b, ans;
scanf("%d", &cas);
for(int k = 1; k <= cas; ++k)
...
分类:
其他好文 时间:
2014-09-28 13:31:12
阅读次数:
184
Problem Description
A range is given, the begin and the end are both integers. You should sum the cube of all the integers in the range.
Input
The first line of the input is T(1
Each...
分类:
其他好文 时间:
2014-09-28 01:35:40
阅读次数:
151