hdu 1075】的更多相关文章

What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others) Total Submission(s): 20680    Accepted Submission(s): 6852 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
http://acm.hdu.edu.cn/showproblem.php?pid=1075 What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 13618    Accepted Submission(s): 4366 Problem Description Ignatius is…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1075 题意:比较简单,易懂,这里不做说明. 解法:第一种方法:用map映射,耗时1000+ms:第二种方法:用字典树处理,500+ms. #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<algorit…
http://acm.hdu.edu.cn/showproblem.php?pid=1075 ;}…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1075 Problem Description Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leav…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others) Total Submission(s): 16042    Accepted Submission(s): 5198 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 12617    Accepted Submission(s): 4031 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
还是写一下,二分搜索好了 这道题开数组比较坑... 二分,需要注意边界问题,例如:左闭右闭,左闭右开,否则查找不到or死循环 先上AC代码 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct Ch{ char a[12]; char b[12]; }; int cmp(const void *aa,const…
Problem Description Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want to translate the history book…
刚学的字典树,代码写得很不熟练.写法上也没有什么特别的优化,就是以1A为第一目标! 可惜还是失败了. 少考虑了一种情况,就是一个单词是另一个单词前缀的问题,写了好久,还是没有1A.不过感觉对字典树有了更深刻的理解. 代码写得不好,看看别人都是怎么写字典树的去. #include<stdio.h> #include<string.h> #include<malloc.h> struct node { node *a[27]; char s[15]; }; char s1[…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others) Total Submission(s): 28482    Accepted Submission(s): 9710 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
Sample InputSTARTfrom fiwohello difhmars riwosfearth fnnvklike fiiwjENDSTARTdifh, i'm fiwo riwosf.i fiiwj fnnvk!END Sample Outputhello, i'm from mars.i like earth! 给你字符串以及它的映射,提问任意一个映射它真实的字符串是什么 #include<stdio.h> #include<algorithm> #include&l…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others) Total Submission(s): 15966    Accepted Submission(s): 5177 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 11730    Accepted Submission(s): 3763 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
题意:单词翻译 思路:map #include<iostream> #include<stdio.h> #include<string.h> #include<map> using namespace std; map<string,string>mp; int main(){ string s1,s2; char c; cin>>s1; while(cin>>s1){ if(s1=="END")bre…
#include<stdio.h> #include<string.h> #include<string> #include<iostream> #include<algorithm> #include<map> using namespace std; map<string,string>mymap; int main() { int i,j,k,n,m; char s[4000],str[30],str2[30]; s…
#include<stdio.h> #include<iostream> struct node { int num,i; node *a[27]; char s[20];//定义局部不是空的 node() { num=0; for(i=0;i<26;i++) a[i]=NULL; } }*root; char s2[20],str[20],str1[3100],s1[20],h[20]; void insert(int len ,node *root) { int i; f…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 21658    Accepted Submission(s): 7228 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others) Total Submission(s): 16042    Accepted Submission(s): 5198 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
首先说字符串的截取套路吧 用坐标一个一个的输入 用遍历的方式逐个去检查字符串中的字符是否为符合的情况 如果是的话 把该字符放入截取string 中 让后坐标前移 如果不是的话 截取结束 坐标初始化 然后是map的使用 头文件为 <map> 定义的话 map<类型,类型> 变量名 对于map中值的传入的话 直接用数组的形式就好 这里由于有搜索 所以还要用到find函数   如果找不到的话 find返回值为end() 再就是string 类型变量的使用要注意 string类型的变量在下…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 31176    Accepted Submission(s): 10700 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
HDU 1000 A + B Problem  I/O HDU 1001 Sum Problem  数学 HDU 1002 A + B Problem II  高精度加法 HDU 1003 Maxsum  贪心 HDU 1004 Let the Balloon Rise  字典树,map HDU 1005 Number Sequence  求数列循环节 HDU 1007 Quoit Design  最近点对 HDU 1008 Elevator  模拟 HDU 1010 Tempter of th…
题目大意: 给你一本火星词典,每个火星单词对应一个英文单词. 然后给你一篇火星文章,要求你翻译成英文. 要求如下: 如果这个火星单词用英文单词可以表示,就翻译成英文,如果没有这个单词,就原样输出.遇到标点符号或者空格原样输出即可. ____________________________________________________________________________________________ 把给的每一个火星词建立trie,并在每个trie节点中建立一个字符串s,用来存储对…
Babelfish Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 30816   Accepted: 13283 Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have…
What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 14107    Accepted Submission(s): 4546 Problem Description Ignatius is so lucky that he met a Martian yesterday. But…
(一)Trie的简单介绍 Trie树,又称字典树,单词查找树或者前缀树.是一种用于高速检索的多叉树结构,如英文字母的字典树是一个26叉树.数字的字典树是一个10叉树. 他的核心思想是空间换时间,空间消耗大可是插入和查询有着非常优秀的时间复杂度. (二)Trie的定义 Trie树的键不是直接保存在节点中,而是由节点在树中的位置决定.一个节点的全部子孙都有同样的前缀(prefix),从根节点到当前结点的路径上的全部字母组成当前位置的字符串.结点能够保存当前字符串.出现次数.指针数组(指向子树)以及是…
http://acm.hdu.edu.cn/showproblem.php?pid=1075 Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K (Java/Others)Total Submission(s): 24477    Accepted Submission(s): 8237 Problem Description Ignatius is so lucky that he met a Mar…
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201…
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029.1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092.1093.1094.1095.1096.1097.1098.1106.1108.1157…
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201 120…