A fundamental question in nutritional biology is how distributed systems maintain an optimal supply of multiple nutrients essential for life and reproduction. In the case of animals, the nutritional requirements of the cells within the body are coordinated by the brain in neural and chemical dialogue with sensory systems and peripheral organs. At the level of an insect society, the requirements for the entire colony are met by the foraging efforts of a minority of workers responding to cues emanating from the brood. Both examples involve components specialized to deal with nutrient supply and demand (brains and peripheral organs, foragers and brood). However, some of the most species-rich, largest, and ecologically significant heterotrophic organisms on earth, such as the vast mycelial networks of fungi, comprise distributed networks without specialized centers: How do these organisms coordinate the search for multiple nutrients? We address this question in the acellular slime mold Physarum polycephalum and show that this extraordinary organism can make complex nutritional decisions, despite lacking a coordination center and comprising only a single vast multinucleate cell. We show that a single slime mold is able to grow to contact patches of different nutrient quality in the precise proportions necessary to compose an optimal diet. That such organisms have the capacity to maintain the balance of carbon- and nitrogen-based nutrients by selective foraging has considerable implications not only for our understanding of nutrient balancing in distributed systems but for the functional ecology of soils, nutrient cycling, and carbon sequestration.