For your data set, taking 18 or 19 is the same. But normally you would take 18.
You're asking about a case that is unusual in two ways:
1) The "curve" is not continuous - it is a step function.
2) One of the "steps" occurs at the percentile you are looking for.
A simpler example would be: 10 students get a mark of 20 and 10 students get a mark or 21, what is the 50th percentile?
The step falls on the 50 percentile mark. In such a situation, you would need to know how that 50th percentile figure was going to be used.
In most cases, it would be reasonable to use 20.5 as the 50th percentile mark - as it provides a dividing line.
But since all of the students who got the 21 are in the 50th percentile and none of those who received 20 are, then the value 21 also works.
Finally, if you are asking the question: what is the minimum mark I would need to get to make it into the 50th percentile, the answer would be 20.000001 - just more than the 10 who got 20.