Does a rock use up energy to maintain its shape?

No, the exact opposite is true.

The molecules in a rock don't stay together because they're spending energy. They stay together because of attractive chemical bonds. The molecules have lower energy when they're together than when they're not, so you have to spend energy to break the rock apart, not to keep it together.

There are various mechanisms that keep solid things together, they all have one thing in common: They reduce energy to a minimum! When you want to break it apart, it costs you energy to do so!

Examples of bonds are:

Hydrogen-Bonds, which are very weak and come from an asymmetry of the electron around the proton, in such a way that it is energetically favourable to form bonds instead of repel each other.

Ion-bonds, which can be quite strong, but the materials are often recalcitrant (brittle). Materials having ion-bonds are not pure, they are a mixture of two different elements, one positively charged, another negatively charged and they form molecules together, mainly due to the Coulomb force.

There are many more!

The amount of work done is equal to the distance moved times the force in the direction of motion. As the rock is staying the same shape it does not need to exert energy.

You may be thinking that the rock needs to expend energy in order to hold up its heavy mass in the same way our muscles do if we hold up a heavy weight. But muscles need to contract to lift a heavy weight and this requires continuous activity at the cellular level as explained in the answer to this question.