The ability to do these sorts of competitions is a learned skill like any other. Certainly, it is a learned skill that has some relation to research ability within mathematics, but neither tests, nor grades, nor classes are the be-all or end-all of skill measurement tools. If you can solve half the questions, you have enough logical ability to accomplish anything short of beating cperciva at a math competition. The true mark of skill is to go use that to create something new--anything else is just practice.