ACM 字符串
青山绿水之辈
奋斗青春年华
展开
-
hdu1039
#include#includeint main(){ char a[100]; int flog,t,i; while(scanf("%s",a)==1&&strcmp(a,"end")!=0) { flog=1; t=0; for(i=0;i if(a[i]=='a'||原创 2013-04-24 22:33:10 · 807 阅读 · 0 评论 -
CF ZgukistringZ
B. ZgukistringZtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor GukiZ doesn't accept string as th原创 2015-06-16 11:59:30 · 862 阅读 · 0 评论 -
poj3080Blue Jeans(在m个串中找到这m个串的 最长连续公共子序列)
DescriptionThe Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth w原创 2013-12-10 22:27:47 · 1165 阅读 · 0 评论 -
poj1782Run Length Encoding(题目难以看懂,也有一些坑)
DescriptionYour task is to write a program that performs a simple form of run-length encoding, as described by the rules below. Any sequence of between 2 to 9 identical characters is encoded b原创 2013-12-01 17:54:19 · 1566 阅读 · 0 评论 -
hdu1708(Fibonacci String)
Problem DescriptionAfter little Jim learned Fibonacci Number in the class , he was very interest in it.Now he is thinking about a new thing -- Fibonacci String .He defines : str[n] = str[n-1]原创 2013-07-22 20:58:12 · 1774 阅读 · 2 评论 -
hdu1263 水果(结构体排序)
Problem Description夏天来了~~好开心啊,呵呵,好多好多水果~~Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.Input第一行正整数N(0每组测试数据的第一行是一个整数M(0Output对于每一组测试数据,请你输出一份排原创 2013-07-19 18:51:05 · 1080 阅读 · 0 评论 -
hdu1288(卖荼)
题目注意两点:1.要尽可能多的钱的数量 2.一定要满足恰好支付的钱能够卖到荼叶,不能多支付钱!!!我就是没有看清题的第2个意思,WA了几次!!!!Problem DescriptionHat is a member of PG Studio. Hat codes a lot and so he often buys tea at tea vending machine. But原创 2013-07-18 20:32:46 · 1490 阅读 · 0 评论 -
hdu1200(来来回回串起来)
Problem DescriptionMo and Larry have devised a way of encrypting messages. They first decide secretly on the number of columns and write the message (letters only) down the columns, padding with ext原创 2013-07-18 14:06:29 · 975 阅读 · 0 评论 -
hdu1228(A+B)
Problem Description读入两个小于100的正整数A和B,计算A+B.需要注意的是:A和B的每一位数字由对应的英文单词给出.Input测试输入包含若干测试用例,每个测试用例占一行,格式为"A + B =",相邻两字符串有一个空格间隔.当A和B同时为0时输入结束,相应的结果不要输出.Output对每个测试用例输出1行,即A+B的值.原创 2013-06-02 14:34:00 · 967 阅读 · 0 评论 -
查询成绩
题目描述波波同学是位大四的学生,同时也是一位考研er。为了考上北京邮电大学,他准备了很长时间。不久前,考研成绩终于公布了。波波登陆了成绩查询网站,发现自己密码竟然忘记了!但是幸好,他还记得其中的某些字母。请你判断,他记忆中的字母是否是正确密码的片段。输入多组样例,每组样例有两行。第一行为正确密码,第二行为波波记得的密码片段,'*'号表示波波不知道的密码片段,可能任意长,也可能为零。每行原创 2013-05-13 22:13:02 · 1269 阅读 · 0 评论 -
hdu1106
#include#includeint main(){ char ch[10000]; int i,j,e,flog; __int64 t,a[10000]; while(gets(ch)) { memset(a,0,sizeof(a));//把a[10000]都初始化为0;a是用来装找出来的数原创 2013-05-04 21:11:43 · 1342 阅读 · 2 评论 -
hdu3293(运用结构体)
Problem DescriptionAs is known to all, long long ago sailormoon once was an association of fighters. Till now, sailormoon is also an association of girls. Owe to some unknown reasons, girls are nece原创 2013-05-22 23:16:16 · 911 阅读 · 0 评论 -
hdu4545(魔法串)
Problem Description 小明和他的好朋友小西在玩一个新的游戏,由小西给出一个由小写字母构成的字符串,小明给出另一个比小西更长的字符串,也由小写字母组成,如果能通过魔法转换使小明的串和小西的变成同一个,那么他们两个人都会很开心。这里魔法指的是小明的串可以任意删掉某个字符,或者把某些字符对照字符变化表变化。如: 小西的串是 abba; 小明的串是 addba;原创 2013-05-21 22:20:18 · 938 阅读 · 0 评论 -
HDU 1274(展开字符串)
Problem Description在纺织CAD系统开发过程中,经常会遇到纱线排列的问题。该问题的描述是这样的:常用纱线的品种一般不会超过25种,所以分别可以用小写字母表示不同的纱线,例如:abc表示三根纱线的排列;重复可以用数字和括号表示,例如:2(abc)表示abcabc;1(a)=1a表示a;2ab表示aab;如果括号前面没有表示重复的数字出现,则就可认为是1被省略了,如:cd(a原创 2013-05-19 21:32:47 · 1289 阅读 · 0 评论 -
hdu3294(找最长回文串)
#include#includechar str[200009];int main(){ int i,hed,end,e,j,maxlen,len; char ch; while(scanf("%c %s",&ch,str)==2) { getchar(); maxlen=0;len=strlen(str原创 2013-05-05 16:29:24 · 1753 阅读 · 0 评论 -
hdu2526(浪漫手机)
#include#includetypedef struct{ char ch[3],c;//ch是音符模式,c是音符}node;char f[1000][1000];int main(){ node str[8]; int t,n,j,i,e; scanf("%d",&t);//输入 while(t--) {原创 2013-05-05 15:13:33 · 1211 阅读 · 0 评论 -
hdu2072(不同单词数)
#include#includechar str[100000][50],ch[100000];int main(){ int word; while(gets(ch)) { if(strcmp(ch,"#")==0) break; word=0; int i,j=0,j1=0,flog=1; for(i=0;i if(ch[原创 2013-05-01 20:17:17 · 1193 阅读 · 0 评论 -
计算客 商品推荐走马灯(简单)(求区间所有连续的回文串价值)
796次 55.1% 2000ms 65536K有一个新的研究显示,人在看见一系列的图片时,如果它们的排列有一定的轴对称性,则会更为觉得赏心悦目。根据这个特性,作为阿里巴巴旗下重要的电子商务交易平台的淘宝,希望了解商品推荐的图片走马灯现在的赏心悦目情况,以便判断是否之后需要做出调整。例如,当价值分别为 1,2,1 的商品图片排列在一起的时候,人们可以看到它的所有非空区间 [1]、[2]原创 2015-07-19 16:24:15 · 1345 阅读 · 0 评论