As Olympic medalists wave from the victory podium, you may imagine the years of training and sacrifice, of singular focus and determination, of selfless family support. But let’s not forget the food: the true stuff of legends. Behind every Michael Phelps and Marion Jones, there’s a long, mostly overlooked, history of energy-rich meals: training and competition diets that help the world’s fastest and strongest to be so fleet and so powerful. Although every world-class athlete follows an individualized diet, carbohydrate-rich foods such as pasta and potatoes pave the road to world records, sports nutritionists and trainers say. The protein and fats so crucial to popular weight-loss diets including Atkins and South Beach play much lesser roles on the world stage of endurance athletics. ‘‘Carbohydrates are the first and primary source of energy that the body uses,’’ says Troy Jacobson, a Baltimore champion triathlete and coach of 2000 Olympian triathlete Joanna Zeiger. ‘‘If a swimmer like Michael Phelps or a bike rider like Lance Armstrong tried to focus on primarily eating proteins and fats, there’s no way they could ever perform the way they do. Depending on the time of year and the emphasis on their training, endurance athletes will eat upward of 70 percent of their calories from carbohydrates.’’ Some of those folks just concentrate on getting enough calories, period. At 19, Michael Phelps not only impresses folks with his grueling workouts — many of his days consist of two-hour swimming sessions twice a day — but also with the thousands of calories he needs to power his 6-foot-4, 195-pound body toward gold medals. EATING, OLYMPICS-STYLE