In 1985, 16-year-old high school student Ted Stroehmann (Ben Stiller) lands a prom date with his dream girl Mary Jensen (Cameron Diaz), which is cancelled after a painful and embarrassing zipper accident. After the ordeal gains the attention of numerous members of the household and community and Ted is carted off to the hospital, he subsequently loses contact with Mary.
13 years later in 1998, 29-year-old Ted is still in love with Mary. On the advice of his best friend Dom (Chris Elliott), he hires a smarmy private detective named Pat Healy (Matt Dillon) to track her down. Healy finds that she is an orthopedic surgeon living in Miami with her friend, Magda, and quickly falls in love with Mary as well. He lies to Ted about her, saying she is grossly overweight with many children, to discourage him from having any contact with her. Healy resorts to lying, cheating, stalking, and even drugging Magda's dog to win Mary over, but is exposed by Mary's architect friend, Tucker (Lee Evans), who is heavily reliant on crutches and speaks with an English accent. Enraged, Healy tails Tucker and discovers him to be a fraud himself: he is an able-bodied, entirely American pizza delivery boy who is also in love with Mary. For years, Tucker has been driving away potential rivals through slander, including one oft-mentioned suitor referred to only as "Brett."
Meanwhile, Ted decides he still wants to reconnect with Mary and, aided by Dom, drives down to Florida and discovers the truth about her. Ted seems to have won Mary's love, until an anonymous letter exposes his connection with Healy, and she breaks contact with him. Ted confronts Healy and Tucker, and Mary is accosted by Dom, who is revealed to be her former boyfriend "Woogie," who "got weird on her" back in high school, stealing all her shoes. When Mary is finally together with all of her deceitful suitors, Ted realizes that the only one who did not resort to lying and manipulation to win Mary was Brett, who turns out to be NFL quarterback Brett Favre. After reuniting Brett and Mary, Ted leaves tearfully until Mary chases after Ted, saying that she would be happiest with him.
The film concludes with the two engaging in a kiss while a guitarist (Jonathan Richman), who periodically narrated the story in song throughout the film, is accidentally shot by Magda's boyfriend, who was trying to shoot Ted so he could win over Mary.

Question: Who does Mary end up with in the end?
Answer: Ted.
Alternative answer: Ted