Is there an idiom for winning a contest because you are the only participant and there is no competitor?
This is known as a walkover.
It comes from horse racing where the sole contesting horse had still to walk over the course to win. The following is from Merriam-Webster:
Definition of walkover
1: a one-sided contest : an easy or uncontested victory
2: a horse race with only one starter
The earliest citations in the OED (1928) (there spelled “walk-over”) are of metaphoric use in an article in the ‘Times’ concerning a parliamentary election in 1838 (spelled “walk over”), and one relating to a horserace in 1861 (hyphenated spelling), although it is not entirely clear whether the latter use is literal or metaphoric. A clear example of literal use in relation to horse racing is in the Report of the California State Agricultural Society of 1885:
On Monday, the fifteenth, the track was in the best possible condition when the first race was called, which was the Maturity stake for four-year olds, a dash of three miles. For this William Boots’ colt Padre had a walkover—Lucky B, Gano, and Augusta E paying forfeit.
However race records from the 18th Century include the verbal use, “walked over”, e.g.
Eclipse ch c 1764 (Shakespeare or Marske - Spiletta, by Regulus)…
In 1769 he won a £50 Plate at Epsom…
Walked over for the King’s Plate at the same meeting.…
I was trying to remember the phrase that I've heard most often (I knew it was "Winner of a... race.") when I saw the comment by Chris Chudziki under David's answer, which filled in the rest of the phrase:
Winner of a one-horse race.
Upon searching for that exact phrase, it seems that it is most often used as part of an insult:
"He couldn't pick the winner of a one-horse race."
But it is used in the manner you described, and I think most native English speakers (at least on the U.S. side of the pond) would recognize the phrase.
From the Free Dictionary comes this entry for No Contest:
- Lit. [in games] a situation where one team fails to appear for a competition.
It was declared no contest because the opposing team was stuck in traffic out on the expressway.
- Fig. a situation where the winner-to-be of a contest is obvious even before holding the contest.
It was no contest. The wrestler was so big and strong that no one could have defeated him.
In the specific circumstance that the contest is an election, in Canadian English you could say that the contestant is acclaimed.
From the OED, acclamation:
Canad. (An instance of) election to an assembly by unanimous or overwhelming assent, unopposed
The Canadian parliament notes that
In Canada, a Member is said to be elected or returned by acclamation when no other candidate has come forward at an election and no vote is held.
Perhaps not surprisingly, most of the google hits for this sense of the term come from Canadian universities' student elections (see the numerous candidates marked "acclaimed" in the University of Waterloo's recent election), since it's relatively rare for actual political positions to go uncontested.
I was surprised no one had posted this, even if it isn't truly generalizable to all contests, because I had no notion that it was exclusively a Canadianism before today; I use the term relatively frequently and am confident that others around me understand it.
In a tournament, if it results specifically from mathematical quirks, like there being an odd number of participants, it may be called a "bye", although I'm uncertain whether that may refer to the victory itself, or just the actual (un-played) game:
the position of a participant in a tournament who advances to the next round without playing
Australia has the idiom 'lay-down misere', which comes from gambling: you could lay all your cards down and still win. As a comment mentions, 'pulling a Bradbury', after our gold medal winning speed skater who was the only person to avoid a collision in his Olympic races, is also an idiom, but won't travel.
If neither of these more colourful phrases suit, 'walkover' is a good idiom that will travel, and 'winner by default' isn't exactly idiomatic but describes what's going on clearly.
This suggests that there was one and only one competitor.
In the case of a one-horse race the common interpretation is that, although there were other competitors, one particular individual was a clear and almost uncontested winner.