6. Several plants and zombies (no more than 20 creatures in total) attended the "Plants VS Zombies" gathering, and it turned out that all creatures were of different heights. Plants always tell the truth to those who are shorter than them and lie to those who are taller. Zombies, on the contrary, lie to shorter creatures and tell the truth to taller ones. Upon meeting, each participant approached every other and said either "I am taller than you" or "I am shorter." The phrase "I am shorter" was heard 20 times. When saying goodbye, each had to approach every other and say "I am taller and I am a plant." If a creature could not say this, it clapped. There were 18 claps. Determine how many creatures attended the gathering, and arrange them by height.

(P. D. Mulyenko)
Solution. Let the total number of beings be $n$, and exactly $z$ of them are zombies. When plants greet, they say to everyone “I am taller than you”, and zombies say to everyone “I am shorter”. Each zombie said this phrase to everyone except themselves, so we get $z(n-1)=20$. Given that $n-1<20$, the possible cases are: $z=2, n-1=10 ; \quad z=4, n-1=5 ; \quad z=5, n-1=4$ (larger $z$ are impossible since $z \leqslant n$).

Now let's examine the farewells. When a plant addresses someone who is shorter, it must tell the truth, and the phrase “I am taller and I am a plant” is true. When addressing someone who is taller, it must lie, and this phrase is a lie (the first part is false). For zombies, this phrase is always a lie, so they can say it to everyone who is shorter, but not to those who are taller. Therefore, all the slaps are performed by zombies to those who are taller. It is not hard to see that of the three cases, only $z=2, n=11$ fits (otherwise, there would be fewer than 18 slaps). Out of 11 beings, the zombies must be the shortest and the third from the bottom in height - only then do we get $10+8=18$ slaps (in other cases, it is either $10+9$ or no more than 17).

Answer: 11 beings; when ordered by increasing height - ZPZPPPPPPP.

Criteria. 3 points if the participant could determine that the number of zombies can be 2, 4, or 5.

Deduct 1 point if the arrangement of beings by height is not explicitly indicated in the solution, but everything else is explained.