Learn DSADSAContests
coding75 logo
LeetCode POTDPOTDSheets
coding75 Pro
coding75 logo
Dashboard
Learn DSA
Course RoadmapFlow
DSA Topic TreeNew 🚀
Contest SolutionsPractice
Practice Sheets
MasterclassesLive 👨🏻‍💻

coding75 ProPRO

Live Classes & Placement Guidance

coding75 logo

The premier developer platform for mastering Data Structures & Algorithms, exploring contest editorials, building ATS-ready resumes, and accelerating your tech career.

Connect & Community

DSA & Contests

  • Learn DSA
  • Contest Solutions
  • LeetCode POTDDaily
  • Practice Sheets
  • MasterclassesSoon

Interview Prep

  • Portfolio Projects
  • CS Fundamentals
  • System DesignSoon
  • Interview ExperiencesSoon
  • Mock InterviewsSoon

Career & Pro

  • Jobs & Internships
  • Resume BuilderATS
  • coding75 Pro
  • Submit Feedback
© 2026coding75•crackDSA™•Maa Lalita Edtech Private Limited. All Rights Reserved.
Privacy PolicyTerms & ConditionsContact Support
Registered Office: Kanpur 208021•Regional Office: Indiranagar, Bangalore, 560008
Maa Lalita Edtech Private Limited
Contests/CodeChef/Starters 146/Knockout tournament
PrevNext
CodeChefCodeChef
2 Star
Starters 146

Knockout tournament

MathNumber Theory
Loading...
Solve on CodeChef

Problem Statement

Official algorithmic problem description and constraints.

Open on CodeChef

A knockout tournament is a type of elimination tournament where the loser of each match-up is immediately eliminated from the tournament. The following image showcases a knockout tournament between 16 players.

In the tournament:

  • Initially, the 16 players are paired into 8 matches in the first round.
  • The winners of these 8 matches proceed to the next round, while the losers are eliminated.
  • The 8 winners from the first round are paired into 4 matches.
  • The 4 winners from the quarterfinals are paired into 2 matches.
  • The 2 winners from the semifinals compete in the final match to determine the champion.

A knockout tennis tournament is organised in Chefland. There are 16 players, and the ith player has a skill level of Si​. It is guaranteed that all skill levels are distinct, that is, Si≠Sj.

It is known that in a match between two players, the player with higher skill level always wins.

For each player i, find the maximum number of matches the player can win in the tournament if the initial pairings are made optimally.

Solutions & Walkthrough

Detailed video explanations, mathematical intuition, and clean C++ implementation code.

Connecting secure classroom stream...
Back to Starters 146
Previous ProblemNext Problem