CT28101

Gino and the Middle Mark

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the basalt cliffs of Obsidian Shore opens only for a perfect tally of vials. Gino means to find out. Task: Print the lower median: the element at position floor((n-1)/2) after sorting (so for even n it is the smaller of the two middles). Input format: First line: n. Second line: n integers. Output format: Print the lower median. Constraints: 1 <= n <= 377; -1000000000 <= a[i],x <= 1000000.

Example 1:

Input: 255 -871999871 -809452614 -80244108 -113691232 -824869732 -469043335 -694082776 -612586847 -534653106 -985910647 -521309993 -445763535 -461863909 -698948440 -620253096 -955094274 -965818206 -488761268 -177798547 -976542020 -965329658 -180321407 -508655870 -616117001 -174466389 -646032936 -825999440 -68366544 -233001987 -284926121 -169256955 -114858699 -551701761 -622105923 -348113774 -631410012 -237674635 -541978019 -132023981 -607876890 -277904527 -879118544 -176701704 -958685279 -458782567 -322844292 -70275290 -989992946 -33614166 -172786887 -207248339 -843405334 -886499047 -383484975 -497423044 -712353461 -261937927 -244476039 -600886432 -967960960 -160223638 -822260660 -898870723 -894972595 -807676910 -42905225 -63057583 -239690634 -766279372 -185132918 -124081202 -986062587 -245417049…
Output: -528509127

Example 2:

Input: 130 -239784542 -31236673 -243101200 -228417469 -899325952 -736772828 -544233308 -565415269 -97262531 -696985366 -391147310 -55083906 -453834385 -955155811 -514722351 -151509720 -615201339 -652702607 -713962633 -129097081 -272088246 -746147796 -392161358 -329439971 -248009648 -892305840 -135240190 -467937159 -688773559 -243399027 -194402596 -807113177 -733600778 -764454289 -549018308 -636245919 -24814031 -232020277 -668514468 -181054719 -576673699 -215623076 -238084108 -652504891 -539430437 -85973031 -969517226 -91706000 -245793850 -169301516 -434246405 -161293176 -530047624 -796306108 -369406509 -903993626 -486405773 -91285305 -897418226 -838369622 -580725507 -952524701 -149729290 -331319971 -154736596 -118244039 -22216427 -430541485 -650781772 -497819543 -216214348 -434507214 -445066484 -…
Output: -465219622

Example 3:

Input: 325 -522858580 -53125037 -941989881 -450091673 -710667657 -11625799 -474981450 -350663983 -941535808 -969602529 -998048865 -82546059 -987089756 -2518484 -713716326 -138649800 -65570790 -537460396 -825487694 -545482129 -530599916 -285668088 -112144320 -317329002 -536268247 -915749629 -563260239 -569515800 -675333666 -442471815 -17759096 -548480606 -694018597 -788558614 -952177918 -698324101 -54030088 -378337846 -308463999 -38193136 -772498552 -302127690 -972155902 -682852914 -175758455 -646768437 -738503561 -142654391 -898568216 -798343845 -207965544 -52093417 -703355702 -42049460 -312426102 -583872250 -184230660 -325805733 -876192900 -276101603 -571756084 -280994618 -252405471 -879012217 -457464293 -174781285 -772715674 -827921203 -959741473 -290730821 -428497369 -182101384 -697844841 -920…
Output: -496580692

Constraints:

1 <= n <= 377; -1000000000 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Gino and the Middle Mark - EASY Coding Problem | CodeTikki