随笔分类 -  算法描述

摘要:#include#include#include#includeusing namespace std;int Next[100005];void getnext(const char *W,int *next){ int j=0,k=-1; next[0]=-1; while(!j || W[j]... 阅读全文
posted @ 2014-11-15 22:13 keyboard3 阅读(100) 评论(0) 推荐(0)
摘要:通过阶段性计算减少一次性的大值计算#include int main(){ int t, a, b, i; __int64 c; scanf("%d", &t); while(t--) { scanf("%d%d", &a, &b); if(... 阅读全文
posted @ 2014-11-15 00:09 keyboard3 阅读(96) 评论(0) 推荐(0)
摘要:D - Palindrome Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice URAL 1297DescriptionThe “U.S. Robots” HQ has... 阅读全文
posted @ 2014-10-30 21:03 keyboard3 阅读(160) 评论(0) 推荐(0)
摘要:#include #include #include#includeusing namespace std;double num[1000000];void init_arrary(){ for (int i = 1; i > n >> m){ double sum=0,res;... 阅读全文
posted @ 2014-10-12 10:56 keyboard3 阅读(316) 评论(0) 推荐(0)
摘要:Longest Repeated SubstringTime Limit:5 Seconds Memory Limit:32768 KBWrite a program that takes a string and returns length of the longest repeated sub... 阅读全文
posted @ 2014-08-19 16:55 keyboard3