CT23617

Felix's vials Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The council of the caldera rim of Firewatch pays by the answer, and Felix intends to earn it. First: the full register of vials. Task: The array is sorted non-decreasing. Print the 1-based position where x would be inserted to keep the order (before equal values). Input format: First line: n and x. Second line: n sorted integers. Output format: Print the insertion position (1..n+1). Constraints: 1 <= n <= 747; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 404 -794533650 -999654359 -999558681 -999144559 -993736444 -990304406 -975934694 -974249408 -971821072 -970177486 -966309377 -962870111 -962656589 -961068840 -957858985 -957732764 -955248644 -954910716 -954746509 -945608319 -945447139 -943262104 -937548107 -933527209 -928187943 -925934867 -925331801 -921373183 -918913861 -913801648 -909956136 -909437775 -909073967 -908932298 -908753185 -891792597 -891130745 -890285974 -883752030 -878953567 -874060532 -873280167 -871219489 -870767061 -869726149 -867640091 -857738525 -856516848 -854026896 -853082250 -844837068 -842706263 -837613016 -835694804 -831344306 -828235907 -824352797 -823324008 -823198042 -821420926 -820595217 -817753685 -816195230 -810638140 -809269892 -808292970 -805925166 -803449995 -798364627 -797522323 -797415894 -797036584 -796…
Output: 73

Example 2:

Input: 497 -129916249 -995019299 -993368743 -992252431 -991961225 -991486884 -990381602 -987683460 -987634588 -986673531 -981438827 -981238265 -980326109 -976915052 -975906971 -974668972 -973335821 -968357834 -966096349 -960759784 -960577487 -959998819 -955719705 -952890369 -949800006 -949167447 -947558181 -945866863 -942598616 -935019961 -933620900 -933586955 -933140197 -931849751 -931034422 -930476148 -927258981 -927094295 -920853473 -920050771 -919917858 -918518752 -913982946 -911390982 -906293644 -904186823 -902510419 -901872497 -901578399 -899785326 -897730005 -891350695 -888822728 -888807989 -888593666 -888248379 -884637302 -883612183 -881072854 -876547248 -874654004 -872474364 -871678066 -869455310 -869313869 -866884094 -866330340 -865960688 -865093012 -864661852 -861815080 -859104853 -856…
Output: 421

Example 3:

Input: 357 -433624919 -994623972 -991264055 -991183633 -989605997 -988478852 -987253337 -986689766 -986296216 -982770080 -977334316 -975001553 -967544121 -967103853 -962894464 -962649817 -958381168 -955435829 -952461854 -949716315 -945769321 -942778931 -939720887 -937744131 -935690446 -933003278 -932819252 -929832003 -927622682 -927424049 -923407773 -921874773 -920843480 -919022877 -916385340 -916151561 -914177252 -914046566 -910734843 -906660198 -901096990 -900748182 -900720988 -899581201 -897778704 -896847857 -894284234 -891456162 -883379563 -882976261 -875772246 -874584194 -872607370 -871999934 -871596059 -870203482 -867519817 -866539316 -865792610 -862748444 -861603464 -860474862 -855066718 -853786336 -846034461 -843251540 -842820699 -841783041 -841260274 -839042874 -831839877 -827198502 -825…
Output: 217

Constraints:

1 <= n <= 747; -1000000000 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.