I had exactly the opposite experience. Graduated from Mathematics/Informatics specialized High School, second worst in class - way off below the average grade. Yet I got for free in the University, because was 9th at the national computer science (informatics) olympiad, and this gave me an automatic "A" (still the high-school diploma was taken, so it was a bit of a risk).
Anyhow - I hated school :) and too bad never finished university (too much parties).