Roy edged out Hales for the man of the match award after also creating two run outs in the Sri Lanka innings.
England bowled well and was slick in the field to restrict Sri Lanka to a mediocre total on a very good batting pitch. Dinesh Chandimal made 52, captain Angelo Mathews 44 and Upul Tharanga hit some late runs for his 53 not out.
England's bowlers kept the Sri Lankans in check throughout, though, on a wicket that was predicted to be good for batting and proved to be sublime with the Hales-Roy partnership. Legspinner Adil Rashid and seamer Liam Plunkett took two wickets each for England, but the opening batsmen stole the show with their ruthless chase.
"I thought it was a brilliant partnership," Sri Lanka captain Mathews said. "Hopefully we can forget about this game as soon as possible."
Hales was first to 100, his third ODI century, and got there as he smashed 26 off five balls from legspinner Seekkuge Prasanna. In those five balls, Hales hit two fours and then three consecutive sixes.
Roy had to rush near the end to make sure he made three figures with the free-hitting Hales threatening to end the game before his partner could bring up his ton. Their partnership bettered England's previous best in ODIS, a 250-run stand for the second wicket between Andrew Strauss and Jonathan Trott at the same ground against Bangladesh in 2010.
"Jason Roy and Alex Hales were absolutely exceptional," England captain Eoin Morgan said. "They put on a clinic for everyone here watching."