loops
The main effect of the topic:
You are in a strange place, and the words in this place are different from the English words. Each English word corresponds to this one local word (all is one by one correspondence, does not appear repeatedly). Then you will give some local words to you to output the corresponding English words.
Analysis and Summary:
English words and local words are simple mapping relationships. There are 100,000 of the number given to the topic, with the hash set up map
Babelfish, babelfishpoj
Question Link
For a simple string HASH question, learn about the elfhash character string of the black book.
const int MAXN = 100010;const int maxn=1000000;const int maxm=100003;const int maxlen=20;class hash{ private: struct node{ char ch[maxlen]; int ptr; node* next; }; node *h[maxm],s[maxn]; int numptr; int Hash(char *key) { unsigned long h=0,g; while(*key)
Tags: des style blog Io color OS AR for SP
Babelfish
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. each dictionary entry is a line containing an English word, followed by a
Babelfish
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 37238
Accepted: 15879
DescriptionYou are just moved from Waterloo to a big city. The people speak an incomprehensible dialect of a foreign language. Fortunately, you had a dictionary to help you understand them.InputInput consists of 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100
Babelfish
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 32988
Accepted: 14189
DescriptionYou are just moved from Waterloo to a big city. The people speak an incomprehensible dialect of a foreign language. Fortunately, you had a dictionary to help you understand them.InputInput consists of 100,000 dictionary entries, followed by a blank line, followed by a message of up to
It indicates that the website cannot be submitted as soon as it is just done =
Sad and sad: % >_
Babelfish
Time limit:3000 Ms
Memory limit:65536 K
Total submissions:31630
Accepted:13613
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.
InputInput consists of up to 100,
Babelfish
Time limit:3000 Ms
Memory limit:65536 K
Total submissions:32169
Accepted:13832
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.
InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. ea
two pictures here!
Hope to help you understand it!
It is required that we translate words from a planet into corresponding English. If there is one word, we will output the corresponding English. If there is no word, we will not output it!
Idea: first, we need to use the word of a planet to create a dictionary tree, and then put the corresponding word "behind the leaf node". We can compare it to an earring with a pendant! Then you can directly search for the translation!
Then, the problem wit
Topic Links:http://poj.org/problem?id=2503Main topic:Give you a dictionary. Every behavior in the dictionary is one English word and one other country word. So that we can use the dictionary to put the English wordsTranslated into other country words, you can also translate other country words into English words. Now give you a few foreign words, Q: In the dictionaryWhether there is a translation of this word. If so, output the translation, otherwise, output "eh".Ideas:This problem can actually
Title Link: http://poj.org/problem?id=2503Test instructions: Translated words, if not found in the dictionary output eh.Idea: a bare dictionary tree.Code:#include Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. POJ 2503 Babelfish (dictionary tree)
This topic let me understand a little map container, so this question is still my view of the problem, the less I see the better ....Map is the map, well, it's easy to use, there is the get () will read newline characters ... GetChar () can also, but scanf () theseFormatted to not be able to attend ... Will exist inside the bufferCode:#include Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. UVA 10282
Title Address: POJ 2503Test instructions: Enter a dictionary, the dictionary format for "English foreign Language" one by one mapping relationship and then enter several foreign language words, output their English translation words, if the dictionary does not exist in the word, then output "eh".Idea: Use map to access foreign language and English mapping relationship, and then look good. Note the input format.#include #include #include #include #include #include #include #include #include #incl
again ). Then some local words are given, and you need to output the corresponding English words.
Analysis and Summary:English words and local words are simple mappings. When the number of questions reaches 100,000, hash is used to create a ing or directly sort the questions and then perform binary search. Even if the problem can be barely passed, the speed should be unsatisfactory.Therefore, the best way to do this is to use a hash table to establish a ing relationship.The speed is good. I ran
POJ2503: Babelfish (Binary)
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.
InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. each dictionary entry is a line containing an English word, followed by a space and a foreign languag
The main idea is to give two words, the previous word is the translation of the next word, that is, there is a key to the value of the mapping relationship, to enter the empty behavior sign end input correspondence, and then input the word output corresponding translation. So this problem can be solved by using the map container of C + + to establish correspondence relation.The code is as follows:1#include 2#include 3#include 4#include 5 using namespacestd;6 intMain () {7 Charstr1[ *] ;8
Babelfish
Time limit:3000MS Memory Limit:65536KB 64bit IO Format:%i64d %i64 U
Submit
Status
Practice
POJ 2503
DescriptionYou are just moved from Waterloo to a big city. The people speak an incomprehensible dialect of a foreign language. Fortunately, you had a dictionary to help you understand them.
InputInput consists of 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words . Each dictiona
Babelfish
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 35828
Accepted: 15320
DescriptionYou are just moved from Waterloo to a big city. The people speak an incomprehensible dialect of a foreign language. Fortunately, you had a dictionary to help you understand them.InputInput consists of 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100
Babelfish
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 35009
Accepted: 14979
DescriptionYou are just moved from Waterloo to a big city. The people speak an incomprehensible dialect of a foreign language. Fortunately, you had a dictionary to help you understand them.InputInput consists of 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100
1. Link:
Http://poj.org/problem? Id = 2503
Http://bailian.openjudge.cn/practice/2503/
2. content:
Babelfish
Time limit:3000 Ms
Memory limit:65536 K
Total submissions:32783
Accepted:14093
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.
InputInput con
Babelfish
Time limit:3000 Ms
Memory limit:65536 K
Total submissions:32988
Accepted:14189
DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.
InputInput consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. ea
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.