hdu 1073 字符串处理】的更多相关文章

题意:给一系列的输出和标准答案,比较二者是AC,PE或WA 字符串处理还是比较薄弱,目前没什么时间搞字符串专题,所以遇到一题就努力搞懂 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> using namespace std; #def…
单词数 HDU 2072 字符串输入控制 题意 lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数.下面你的任务是帮助xiaoou333解决这个问题. 有多组数据,每组一行,每组就是一篇小文章.每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束. 每组只输出一个整数,其单独成行,该整数代表一篇文章里不同单词的总数. 解题思路 我的是使用map来进行统计的,确实比较慢了一些,因为输入的问题代码也写的比较垃圾.之后看了网上的…
Problem Description Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file, then the system compare the two files. If the two f…
题目链接 Problem Description Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file, then the system compare the two files. If the…
Online Judge Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4977    Accepted Submission(s): 1889 Problem Description Ignatius is building an Online Judge, now he has worked out all the problem…
http://acm.hdu.edu.cn/showproblem.php?pid=1073 模拟oj判题 随便搞,开始字符串读入的细节地方没处理好,wa了好久 #include <iostream> #include <cstdio> #include <cstring> #include <map> using namespace std ; ],s2[] ; ],s4[] ; int main() { int t ; scanf("%d%*c…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1073 Problem Description Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file,…
http://acm.hdu.edu.cn/showproblem.php?pid=4821 昨晚卡了非常久,開始TLE,然后优化了之后,由于几个地方变量写混.一直狂WA.搞得我昨晚都失眠了,,. 这几次hash军写错的变量--tmp=(j==m-1)?ah[j]:(ah[j]-ah[j-m]*base[m]);  外层循环变量是i,我写的字符串hash的几题都写成tmp=(i==0)? ah[j]:(ah[j]-ah[j-m]*base[m]); 二逼啊 题目大意: 给定一个字符串(最长10^…
/*普通的hsah 由于元素太多 空间很小..hash碰撞很厉害.30分*/ #include<iostream> #include<cstdio> #include<cstring> #include<map> #define maxn 100010 #define mod 2000007 #define hs 117 using namespace std; ],l1[maxn],l2[maxn]; ],c,s1[maxn][],s2[maxn][];…
Problem Description 哈利波特在魔法学校的必修课之一就是学习魔咒.据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助. 给你一部魔咒词典.当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能:当哈利需要某个功能但不知道该用什么魔咒时,你的程序要替他找到相应的魔咒.如果他要的魔咒不在词典中,就输出“what?” Input 首先列出词典中不超过100000条不同的魔咒词条,每条格式为: [魔…