Select column A first, then create a new conditional format and select "Use Formula ..."
Then enter the formula in the input box:
=RANK($A 1,A:A)= 1
Set the format to red and confirm.
Continue to create a new conditional format in the same way, and the formula is:
=RANK($A 1,A:A)=2
=RANK($A 1,A:A)=3
=RANK($A 1,A:A)=4
……
Set the corresponding color.