Great Britain's men will face defending champions Hungary in the group stages of the Olympic water polo competition.
The United States, who won silver four years ago in Beijing, and Serbia, who were third, are in Group B with Britain along with Montenegro and Romania.
There are 12 teams in the tournament with the top four in each group going through to the quarter-finals.
In the eight-team women's competition, Britain will take on Italy, Russia and Australia in Group B.
Australia, who won bronze in 2008, won last weekend's test event at the Water Polo arena.
The competition takes place from 29 July - 12 August.
Group A - Greece, Italy, Kazakhstan, Spain, Australia, Croatia
Group B - Hungary, Montenegro, Romania, Great Britain, USA, Serbia
Group A - Hungary, Spain, China, USA
Group B - Italy, Great Britain, Russia, Australia