摘要:题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=6208 题意:给你n个串,能不能在这n个串中找到一个串,使得其它所有的串都是这个串的子串。 题解:找到最长的串作为主串,将主串hash一下,然后去匹配其它串即可 代码: 1 #pragma
阅读全文
摘要:A:因为删除是不计入操作次数的,所以转化一下就是求最长上升子序列,简单dp。 设dp[i]表示前i个字符能凑成上升子序列的最大长度,dp[i] = max(dp[j]+1, dp[i]) 【j < i && s[j] < s[i]】 1 #include <bits/stdc++.h> 2 usin
阅读全文
摘要:Vases and Flowers Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3263 Accepted Submission(s): 12
阅读全文
摘要:1011: [HNOI2008]遥远的行星 Description 直线上N颗行星,X=i处有行星i,行星J受到行星I的作用力,当且仅当i<=AJ.此时J受到作用力的大小为 Fi->j= Mi*Mj/(j-i) 其中A为很小的常量,故直观上说每颗行星都只受到距离遥远的行星的作用。请计算每颗行星的受力
阅读全文
摘要:D. Little Girl and Maximum XOR time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A little
阅读全文
摘要:PLSQUARE - Palin Square #dynamic-programming #hashing #dynamic-programming #hashing Kids just learnt about palindrome strings yesterday. Today, the te
阅读全文
摘要:TAP2013H - Horace and his primes no tags no tags [The original version of this problem (in Spanish) can be found athttp://www.dc.uba.ar/events/icpc/do
阅读全文
摘要:COLONY - Linearian Colony no tags no tags Description Linearians are pecurliar creatures. They are odd in several ways: Every Linearian is either red
阅读全文
摘要:A:【读题+细节】 【排序+贪心】 题意: 有n张牌,分给n/2个人,每人两张,要求每个人牌上的数值之和相等,输入保证有解。 题解: 先将所有牌面排序,那么依次给每个人分配【最小,最大】【次小,次大】。。。。。。即可【学习按关键字排序】 B:【读题+细节】 题意: 给你t,s,x。且有一个序列是这样
阅读全文
摘要:A. Meeting of Old Friends time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Today an outsta
阅读全文
摘要:C. New Year Snowmen time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As meticulous Gerald
阅读全文
摘要:A. New Year Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. New Year Table time
阅读全文
摘要:Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17736 Accepted: 4516 Description Farmer John is assigning some of his N (1
阅读全文
摘要:题目描述很简单 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 输入一棵树的中序遍历和先序遍历,输出后序遍历。 Input 输入多组数据。 每组数据的第一行: 树的中序遍历。 每组数据的第二行:
阅读全文
摘要:阶乘问题 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description N的阶乘写作N!,表示小于等于N的所有正整数的乘积。 阶乘会变大得很快,如13!就必须用32位整数类型来存储,到了70!即使用浮点数也存
阅读全文
摘要:题目链接:http://codeforces.com/contest/670/problem/C
阅读全文
摘要:L2-011. 玩转二叉树 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 时间限制 400 ms 时间限制 400 ms 内存限制 65536 kB 内存限制 65536 kB 代码长度限制 8000 B 代码长度限制 800
阅读全文
摘要:题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25979
阅读全文
摘要:manacher算法:点击打开链接 邝斌模板:
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3068 求最长回文串,manacher算法。具体可以看转载的blog,代码如下:
阅读全文