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…
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…
题目链接: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…
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 题意 : 给一个单词表然后给一些单词,要求翻译单词表中有的单词,没有则直接输出原单词. 翻译文段部分getchar()输入即可,需要仔细一点,但是很简单不恶心 代码 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #incl…
http://acm.hdu.edu.cn/showproblem.php?pid=1075 ;}…
题意: 给你一个字典 一个英文单词对应一个火星单词 给你一段火星文翻译成英文 字典上的没有的不翻译 分析: 没有给数据规模 字典树用链表 #include <map> #include <set> #include <list> #include <cmath> #include <queue> #include <stack> #include <cstdio> #include <vector> #incl…
H Hyper Prefix Sets Prefix goodness of a set string is length of longest common prefix*number of strings in the set. For example the prefix goodness of the set {000,001,0011} is 6.You are given a set of binary strings. Find the maximum prefix goodnes…
BUPT2017 wintertraining(15) #7C 题意 求[min((Z+L)%N,(Z+R)%N)+1,max((Z+L)%N,(Z+R)%N)+1]中不同前缀的个数,Z是上次询问的结果,N是字符串总个数.Q次询问. 题解 用主席树,即函数式线段树,维护前i个字符串的区间和(每个区间的前缀个数之和). 读入每个字符串后,用Trie树给它的每个前缀分配ID,并记录每个前缀最后出现的位置pre[cur],如果当前的前缀出现过,则线段树中上一次出现的位置的值-1,相当于只把这种前缀记录…