Running for president is a long slog, particularly for the opposition candidate, who must spend two years shaking hands in Iowa and New Hampshire just to win the nomination.

But nothing compares to the last month, when campaign schedules cross a line into outright cruelty.

"We're gonna pull an all-nighter," Barack Obama told supporters at the Mississippi Valley Fairgrounds in Davenport.

"No sleep. We're starting in Iowa, then we're gonna go to Colorado, then Nevada, California, then we're gonna go to Florida, then Virginia, Ohio and then to Illinois to vote."

This involved spending 19 hours on Air Force One, where he passed the time making personal appeals to undecided voters by telephone. They say every vote counts, but this is ridiculous.

Mitt Romney called the president's dash a desperate last-ditch attempt to shore up support.

"His is a message of going forward with the same policies of the last four years, and that's why his campaign is slipping and ours is gaining so much steam," the Republican nominee told a crowd in Henderson, Nevada, starting a trip to Colorado, Iowa, Ohio and Florida that racked up almost as many air miles as his rival.

Romney will never generate the enthusiasm that Obama does in person, but his crowds have been getting bigger since his commanding performance in the first presidential debate. A rally in Denver, Colorado, drew an estimated 6000 people. An election that seemed lost in the summer is now a dead heat.

How close is it? Four different organisations track the hundreds of polls being conducted nationally and at state level, feed them into a statistical model and assess the overall state of the race.

Three show Obama in the lead: Pollster by 0.1%, Talking Points Memo by 0.9% and the New York Times by 1.4%. Only Real Clear Politics has Romney up by 0.7% – but all four results are well within the margin of error.

There has been speculation Obama could lose the popular vote but hang on to the White House, thanks to the idiosyncrasies of the Electoral College. In this scenario, Romney runs up huge victories in the south and the Appalachian region, but comes up short in the nine swing states that matter: Ohio, Florida, Virginia, Colorado, Nevada, Wisconsin, Iowa, New Hampshire and North Carolina.

Obama has a narrow but persistent lead where it counts. He can also afford to lose more of the toss-ups than Romney, because densely-populated states like California and New York guarantee him large numbers of electoral college votes. If Romney fails to capture Ohio, it becomes imperative for him to win Nevada and Colorado. There are endless permutations, including a tied election that would be settled in Romney's favour by the Republican majority in the House of Representatives.

In the final few days, it comes down to the air war versus the ground game. Which candidate's message will cut through the endless political adverts? And which party can turn out its supporters most effectively?

Kantar Media, which tracks campaign spending, estimates that the bill for television advertising will come to $3.3 billion. More than 915,000 campaign adverts have been broadcast, including 80,000 in Las Vegas alone. For the beleaguered voters of Nevada, the vast majority of whom made up their minds months ago, it is impossible to channel-surf their way out of the campaign.

"We have a joke around here," said Lisa Howfield, who manages the local NBC station. "Pretty soon we're going to have such long commercial breaks that people are going to tune in and all they'll hear is: 'Hello, welcome to News Three. And goodbye.'"

Ann Romney said she has given up watching television altogether to avoid the adverts. "I don't want to get myself upset," she told The View. "Trust me, the audience members that are in swing states are sick of them."

In his speech at the Democratic National Convention, Obama also affected to sympathise: "If you're sick of hearing me approve this message, believe me, so am I."

Still the campaigns bombard each other, in what can seem like a pointless war of attrition. The most expensive election ever is also the most negative: only 11% of Romney's spots are positive in tone and just 6.3% of Obama's, meaning that almost 94% of the airtime purchased by the president's team has been devoted to attacks on Romney.

Conservative "Super PACs" such as Karl Rove's Crossroads are equally relentless in their attacks on Obama. Anyone basing their judgement on adverts alone would conclude that both men are utterly unfit to lead the country.

Most of the people I met in Ohio said they were fed up with the negativity. Eric Vernon, who owns Economy Auto Sales in Martins Ferry, asked "When did elections become about mudslinging? Tell me what you're good at. Tell me where you stand."

Down the street, at the Chevrolet dealership, Richard Vince told me "You almost have to watch the adverts." His colleague, Joe Staffilino, said "I watch it and laugh. I hate it. Just be a man, say your point and go on."

"I get so discouraged that a lot of times I just tune it out," said Pastor Sharon Van Dam, of St John's Lutheran church. "I know there are a lot of people round here who feel that way, that just don't listen to it."

This may be so, but then no-one ever admitted to buying a pair of Levi's to have a bath or bringing home instant mashed potatoes because the Martians told them to.

Conservative groups opposing the Affordable Care Act outspent the government by three to one and won the battle for public opinion decisively. When the New York Times canvassed voters, very few owned up to being influenced by commercials, but many repeated their messages verbatim, saying the USA could not afford the reforms and that a "government takeover" of the health system would limit patient choice and introduce rationing.

"Clearly the candidates wouldn't be spending the millions of dollars if they didn't believe the adverts work, and there is plenty of research showing that negative advertising has an impact," said Adam Skaggs, a campaign finance expert at the Brennan Centre for Justice in New York.

"But candidates are wary of being too negative: they sometimes want to take the high road and have positive, inspirational messages. The outside groups have no qualms about taking the lowest road possible."

In Florida, billboards show Obama (whom 34% of Republicans believe to be a Muslim) bowing to kiss the King of Saudi Arabia's hand. In Ohio, voters received a DVD called Dreams From My Real Father, alleging that Obama is the son of Frank Marshall Davis, a Communist Party activist. In a thousand online videos, Romney is demonised as a tax-dodging robber: "the guy who fired your father."

Romney has been running to the centre, moderating and sometimes abandoning the hardline conservative opinions he espoused to win the nomination. Obama's stump speech features a section about a disease called "Romnesia" that causes people to forget their former views: "If you say you'll protect a woman's right to choose, but you stood up at a primary debate and said that you'd be 'delighted' to sign a law outlawing that right to choose in all cases – man, you've definitely got Romnesia."

A Romney campaign advert on heavy rotation in suburban Virginia aims to counter this. "I looked into it," says the young female narrator. "Turns out Romney doesn't oppose contraception at all. He thinks abortion should be an option in cases of rape, incest and to save a mother's life."

This compassionate conservative position took a hit when a Senate candidate in Indiana, Richard Mourdock, said that pregnancies resulting from rape are "something that God intended to happen."

Within hours, an Obama campaign advert showed Romney endorsing Mourdock and spelled out his running mate Paul Ryan's "extremist" views on abortion.

Every election needs a gimmicky nickname for undecided women voters: from "soccer moms" to "security moms" and now "waitress moms" or "Wal-Mart moms". Both campaigns are pandering to these mythical suburban creatures, who are apparently too busy running a household to have firm political views. Other coveted demographic groups include military veterans in Virginia, Catholics in the Midwest, miners in eastern Ohio, and elderly Florida Jews.

In a contest this close, the result may well come down to which campaign is able to translate support into votes. Political professionals estimate that an effective ground game can be worth a 2% swing, which could be the difference between success and failure in Ohio, Florida and elsewhere.

"The ability of the Obama campaign to raise money from small contributions has enabled them to devote more resources to their ground game," said Skaggs. "So while Romney has the advantage in the amount of money they can pour into TV ads, it looks like Obama will have an advantage on the ground."

The Republican National Committee claims to have knocked on 23 times as many doors in Ohio as it did four years ago. Democrats note that Obama For America has 125 field offices in the state, compared to 40 Romney Victory Centres.

In Nevada, Senate majority leader Harry Reid has built a formidable ground operation that even Romney's campaign manager admits is "better and more disciplined" than his own team. With unemployment at 12% in the state, it will need to be.

In Ohio, around 45% of voters are forecast to cast their ballots before election day. In Florida, only a third of voters will wait until November 6. In Colorado, up to 85% may vote early in person or by post.

"How about we get in our car, vote early, and bank our votes," said Senator Rob Portman, warming up a crowd for Romney in Cincinnati, Ohio "so that on Election Day we can make sure other people get out and vote." Republicans have stepped up their efforts, chastened by Obama's huge advantage in early voting four years ago. first exit polls from Colorado and Florida suggest the gap has narrowed.

A Time magazine poll released on Thursday had the race tied in Ohio among people yet to vote, but among early voters, Obama led 60% to 30%, giving him a 5% lead overall. This is essential for Democrats, because core groups in their coalition, including young people, African-Americans and Hispanics, have historically low turnout rates. The most loyal Republican constituencies vote in huge numbers.

At Obama's rally in Dayton, Ohio, there were buses waiting to take people directly to the polling station. When the crowd chanted in unison, the refrain was not "four more years" or "yes we can," but "vote, vote, vote."