luogu#P2159. [SHOI2009] 舞会
[SHOI2009] 舞会
Background
Description
OItown is holding its annual super dance party.
To make this year’s party bigger than ever, the organizer Constantine invited many of his friends and classmates.
On the day of the party, exactly boys and girls came.
Constantine noticed that, in general, in a pair the boy is taller than the girl, but there are occasional exceptions.
So Constantine wants to know: if we pair these people into exactly couples, how many ways are there such that at most couples have the girl taller than the boy?
Now Constantine asks you, who is attending SHTSC, to compute the answer.
Of course, he will first tell you the heights of all students.
Output Format
Output a single integer in one line: the number of pairing schemes where among the couples, at most couples have the girl taller than the boy.
3 0
178
188
176
168
178
170
4
Hint
Constraints: For of the testdata, , , and all heights are positive integers not greater than .
Translated by ChatGPT 5