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/Codeforces/Codeforces Round 936/A. Median of an Array
Next
CodeforcesCodeforces
Pupil
Codeforces Round 936

A. Median of an Array

ArrayMath
Loading...
Solve on Codeforces

Problem Statement

Official algorithmic problem description and constraints.

Open on Codeforces

You are given an array π‘Ž of π‘› integers.

The median of an array π‘ž, where π‘ is the array π‘žsorted in non-decreasing order. For example, the median of the array [9,5,1,2,6] is 5, as in the sorted array [1,2,5,6,9], the number at index βŒˆ52βŒ‰=3⌈52βŒ‰=3 is 5, and the median of the array [9,2,8,3] is 3, as in the sorted array [2,3,8,9], the number at index βŒˆ42βŒ‰=2⌈42βŒ‰=2 is 3

You are allowed to choose an integer π‘– (1≀𝑖≀𝑛) and increase π‘Žπ‘– by 1 in one operation.

Your task is to find the minimum number of operations required to increase the median of the array.

Note that the array π‘Ž may not necessarily contain distinct numbers.

Solutions & Walkthrough

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

Connecting secure classroom stream...
Back to Codeforces Round 936
Next Problem