oj题
会夜明的猪
这个作者很懒,什么都没留下…
展开
-
HDU 2072
Problem Description lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。 Input 有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。 Output 每组只输出一个整数,转载 2016-12-22 09:20:56 · 545 阅读 · 0 评论 -
CodeForces - 4C
A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You'r原创 2017-01-25 23:12:18 · 468 阅读 · 0 评论 -
1368 DNA Consensus String
下面是代码 #include #include main() { char qian[55][1010]; int i,n,a,b,biaoji[4],max,j,sum,p; scanf("%d",&n); while(n--) {sum=0; scanf("%d%d",&a,&b);getchar(); for(i=0;转载 2017-01-23 15:04:33 · 289 阅读 · 0 评论 -
232 Crossword Answers
我用了一天多的时间来做这个题,从连题都看不懂,到思路混乱,到写出来差不多能运行但是有bug的代码,再到将自己写的一百行代码缩减到五十行,再到算法的逐渐精炼,我不管我能写多少代码,但是我希望我写的代码都是精品,又想起那句话,重剑无锋,大巧无工,代码也是如此。 这个题我栽在格式上了,题目要求,在可执行输入后,每个输出之间需要有一个空行,我在第一个输出后直接加了个空行再开始的第二次的输入,这样是错误的原创 2017-01-22 12:48:02 · 247 阅读 · 0 评论 -
227 Puzzle
这个题是给出一个5*5的方格 里面有一个空格,要求输入各种字符来代表空格的移动并输出移动后的5*5图形, ***这个题给我的收获是如何跳出一个多重循环,比如for(x=0;x 代码如下 #include #include int main () { int cases = 0; bool line = false; char initial [5] [7];转载 2017-01-20 22:22:19 · 173 阅读 · 0 评论 -
HDU - 1087
T原创 2017-02-17 18:29:36 · 181 阅读 · 0 评论 -
455 periodic strings
这个题是求在一个没有空格的字符串中,最短的重复的语句的长度是多少 这个题也许用其他方法也能做出来,但我感觉做这个题所运用的思路非常好 #include #include main() { int n,len,k,i; char str[100]; scanf("%d",&n); while(n--) { scanf("%s",str);转载 2017-01-17 16:49:49 · 195 阅读 · 0 评论 -
感觉自己做这个题的思路很不错 1225 Digit Counting
这是代码 #include #include main() { int m,i,l,qian2[10],x,y; scanf("%d",&m); while(m--) { memset(qian2,0,sizeof(qian2)); x=0; scanf("%d",&l); for(i=1;i<=l;原创 2017-01-17 13:38:34 · 357 阅读 · 0 评论 -
oj题 根据化学方程式计算摩尔质量
很长的一个英文题 感觉还可以 这是代码 #include #include int main() { int n,l,i,m,shuliang; char qian[500]; float sum,zhong; scanf("%d",&n); while(n--) { shuliang=0;原创 2017-01-15 16:15:42 · 733 阅读 · 0 评论 -
一个斐波那契数列题 HDU 2041
有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法? Input输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1Output对于每个测试实例,请输出不同走法的数量Sample Input 2 2 3 Sample Output 1 2 这道题的思路是逆向思维,最后一级只能是m-1步或是m-2步总的走法就是m-原创 2016-12-22 14:17:09 · 320 阅读 · 0 评论 -
HDU 1072
Description Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explode原创 2017-05-22 21:59:20 · 179 阅读 · 0 评论