Apart from the fact that each person reacts differently to different foods, there are a few basic dietary rules you should follow if you do competitive sports.
You should go into a competition or race with full reserves of energy and fluids. That way you won't have to contend with digestive problems in the heat of the fray. This is also why your diet should get lighter and more easily digestible as the big moment approaches.
Your last main meal should be three to five hours before the competition. Pasta, corn, potatoes, white rice and refined bread are all good because they contain easily digestible carbohydrates.
In the last hour before the start it's best to limit yourself to small snacks – or even better, fluids (for example small sandwiches with white bread, sport bars or sports drinks), and go very easy on fatty, protein- and fibre-rich foods, which all take too long to digest.
If the temperature's high and you can expect to lose a lot of water, in the last quarter hour before the competition you can drink up to a half litre of fluids. Under normal circumstances you shouldn't start the competition or race thirsty.
According to the Swiss Sports Nutrition Society it's only worth eating or drinking during the competition itself if it lasts more than 45 minutes. Depending on the temperature, the intensity of effort and your weight, the rule of thumb is to drink 0.4 to 0.8 litres an hour.
During a protracted race or competition it's best to take on carbohydrates in liquid form. This will prevent you from tiring too quickly, and will keep you highly concentrated and alert. Given that the amount of carbohydrates you require varies significantly depending on the sport, it's hard to give a general recommendation. You'll find examples of what to eat during competition on the Swiss Forum for Sport Nutrition website.