The CS Nerd thinks that he can impress the girl by performing well in contests. As a result, he has decided to write the CCC (Canadian Chemistry Competition).
Surprisingly, there are only types of chemistry problems in existence! The types of problems will be listed in order of the CS nerd's preference for that type of problem. That is, the type is preferred over the type if .
The CCC consists of problems, numbered from to . The CS Nerd scans through the problems and quickly determines the type of each problem. He would like to complete the problems in order of preferred problem type, breaking ties by solving earlier problems. In what order should he complete the problems in?
Input Specification
The first line of input will contain a single integer, .
The next lines of input will each contain a string with a maximum of 20 characters, consisting of only lowercase English letters. The line specifies the type of problem. No two lines will contain the same string.
The next line of input will contain a single integer, .
The next lines of input will each contain a string. The line specifies the problem type of the problem. It is guaranteed that each string was present in the lines of input specifying the problem types.
For 4 of the 15 points, .
For an additional 6 of the 15 points, .
Output Specification
The output will consist of lines. On the line, output a single integer specifying the problem that the CS nerd should complete.
Sample Input
5
equilibrium
trivial
organic
lab
adhoc
7
trivial
organic
adhoc
equilibrium
trivial
lab
adhoc
Sample Output
4
1
5
2
6
3
7
Comments
Aflatoxin B1
League community:
Aflatoxins are a family of toxins produced by certain fungi that are found on agricultural crops such as maize (corn), peanuts, cottonseed, and tree nuts. The main fungi that produce aflatoxins are Aspergillus flavus and Aspergillus parasiticus, which are abundant in warm and humid regions of the world.
yw saved you 2 minutes of searching on ChemSpider.
Does the CCC care how long your program takes to run? In other words, do they care about program speed?
Yes.
Do you know what the time limit is?
This comment is hidden due to too much negative feedback. Show it anyway.
It changes for each problem.
do it get extra marks for naming that?
You get an upvote.
I cant do this problem cuz c does not contain string! using 2D char array I need a size of the string!
Each string will have a maximum of characters, as stated in the problem description.
Thx for pointing out! I will check my algorithm\(None\)