题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2680Choose the best routeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others...
分类:
其他好文 时间:
2014-08-20 21:05:22
阅读次数:
216
题目链接:
huangjing
思路:
选取字典序最小的串,那么值得考虑的是当两端出现相等时,继续比较,直到出现不同的结果。。
题目:
代码:
#include
int main()
{
__int64 sum;
int max_num,candy,t,n,i;
scanf("%d",&t);
while(t--)
{...
分类:
其他好文 时间:
2014-08-20 16:23:02
阅读次数:
236
UVA 12338 - Anti-Rhyme Pairs
题目链接
题意:给定一些字符串,每次询问求出两个字符串的最长公共前缀的长度
思路:把字符串排序,就能求出height和rank数组,然后利用RMQ查询即可
代码:
#include
#include
#include
#include
#include
using namespace std;
co...
分类:
其他好文 时间:
2014-08-20 01:24:35
阅读次数:
300
题意 给你一个字符序列 你每次可以从它的头部或尾部拿出一个字符组成一个新的字符序列 输出这样做能达到的最小的字符序列 每行最多输出80个字符(开始被这个坑了好久)
直接模拟就行 哪边小就选哪边 相等就往内看
#include
#include
#include
using namespace std;
const int N = 30010;
int main()
{
...
分类:
其他好文 时间:
2014-08-19 20:54:15
阅读次数:
255
Google Book
Time Limit: 1000MS
Memory Limit: 32768KB
64bit IO Format: %lld & %llu
[Submit]
[Go Back] [Status]
Description
You, the best hacker in the world, w...
分类:
其他好文 时间:
2014-08-19 20:50:15
阅读次数:
237
Google Book
Time Limit: 1 Second
Memory Limit: 32768 KB
You, the best hacker in the world, want to download the books published on Google Book. After some investigation, you found that...
分类:
其他好文 时间:
2014-08-19 16:38:05
阅读次数:
222
1. First of all, you will need to be clear on your intentions. Do you really want to play the violin? or was this wish merely conceived when your best...
分类:
其他好文 时间:
2014-08-18 20:08:42
阅读次数:
201
题意:看那张图就一清二楚了吧, N个序列首位相连(相同的序列部分),得到最短的总序列。
题目链接:http://poj.org/problem?id=1699
~~~~
思路就是:将N个序列首尾相连能重合的长度求粗来。然后DFS枚举每种首尾相连的情况。
#include
#include
#include
#define N 22
#define INF 0x7fffffff
us...
分类:
其他好文 时间:
2014-08-16 22:32:41
阅读次数:
185
DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home ...
分类:
数据库 时间:
2014-08-16 11:08:00
阅读次数:
268