oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

medianstring Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

medianstring.html

Rar the Cat is back for more fun and games! But this time he wants to find the median of the numbers on his string!

You did a great job (presumably) the last time he wanted to play. So he wants you to help him again while he plays with the meany mean strings.

Help Rar find the median of all the numbers!

The median of a sequence of numbers is defined as the number in the "middle" of the string.

Input

The first line of input containes an  odd integer, N, that denotes the length of the string of numbers.
This is followed by N integers, the ith integer being the ith number on Rar's string.

Output

A single number, the median of the number on the string

Limits

0 <= N <= 1000

Sample Input 1

5
1 2 3 4 5

Sample Output 1

3

Sample Input 2

7
3 6 2 7 5 4 9

Sample Output 2

7

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110031s32MBAverage
2021s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o medianstring -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.