Question: this is a practice problem on kattis I am having some trouble on. I was writing it in python 3 You are given two integers
this is a practice problem on kattis I am having some trouble on. I was writing it in python 3




You are given two integers N and t; and then an array A of N integers ( 0 -based indexing). Based on the value of t, you will perform an action on A. \begin{tabular}{l|l} \hlinet & Action Needed \\ \hline 1 & Print "Yes" if there are two integers xA and yA such that x=y and x+y=7777, or "No" otherwise (without the quotes) \\ 2 & Print "Unique" if all integers in A are different; \\ or print "Contains duplicate" otherwise (without the quotes) \\ 3 & Find and print the integer that appears >2N times in A; \\ or print 1 if such integer cannot be found \\ Find and print the median integer of A if N is odd; \\ or print both median integers of A if N is even (separate them with a single \\ space) \end{tabular} 5 Print integers in A that fall between a range [100999] in sorted order; (print a single space between two integers) Input The first line of the input contains an integer N and t ( 3N200000; 1t5) The second line of the input contains N non-negative 32 -bit signed integers. Output For each test case, output the required answer based on the value of t. Scoring There are 20 hidden test cases that test various requirements of this problem. All 20 test cases will be tested. Each hidden test case worth 5 points (the 5 sample test cases below worth 0 point). Sample Input 1 Sample Output 1 Sample Input 2 Sample Output 2 Sample Input 3 Sample Output 3 Sample Input 4 Sample Output 4 Sample Input 5 Sample Output 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
