Count of MaximumProblem code: MAXCOUNT |
All submissions for this problem are available.
Given an array A of length N, your task is to find the element which repeats in A maximum number of times as well as the corresponding count. In case of ties, choose the smaller element first.
Input
First line of input contains an integer T, denoting the number of test cases. Then follows description of T cases. Each case begins with a single integer N, the length of A. Then follow N space separated integers in next line. Assume that 1 <= T <= 100, 1 <= N <= 100 and for all i in [1..N] : 1 <= A[i] <= 10000
Output
For each test case, output two space separated integers V & C. V is the value which occurs maximum number of times and C is its count.
Example
Input: 2 5 1 2 3 2 5 6 1 2 2 1 1 2 Output: 2 2 1 3 Description: In first case 2 occurs twice whereas all other elements occur only once. In second case, both 1 and 2 occur 3 times but 1 is smaller than 2.
| Author: | yellow_agony |
| Date Added: | 18-01-2012 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

sir as i have run the code in
Getting runtime errror while
hi there...can we import java
yes... only java libraries..
can u please say what is
can u tell me for which case
Please read
my code is running fine in my
it will also be helpful if u
@deba_22 : Sorry, but we
iam gettin an run time error
Sir, iam getting Runtime
sir as i have run the code in
am getting the ans corect bt
hey admin plz clarify whether
I h`ve tried many times by
admin, i am not getting run
why its showing wrong answer
why can't we submit solution
Hi my code is working
@arpitjindal - Check the
@rohit_p : As you can see
when I submitted solution of
I have a question.Do I have
shit man..wht the f##k... hey
string functions are not
@deepai_dutta : You can
hello, i want to ask? why i
Hello, I want to ask why I
Runtime error plz
its working fine on my
my mistake :P
my runtime comes out to be
Thank you CodeChef....
@admin hello sir just wanted
I found out my error where
@admin: can u tell me why i
Getting runtime errror while
Can i get to know the
wrong ans.. it works fine on
@admin: as i have run the
*Solution ID:824262
sir the code generates no
@shailu95:: Click on my
admin i have run the code in
which compiler is used for c
i think here gcc is used...
@admin codechef dosn't
-----------------------------
Hi my code is working fine in
My code works fine in eclipse
my program working correct on
i am getttin correct answer
what is runtime error SIGABRT
Admin Some one by name
any one plz give me....some
wat is wrong in my code....is
well can any one tell me that
what is source limit? Is it
hi there...does wrong answer
i want some more examples...
When you are getting correct
What is Runtime Error: NZEC?
I am getting a run time error
@admin: What should be the
@dhin730 ... then print the
what is worng in my code , it
I repeat with emphasis that
hey my java program is
hav u observed?? not even
I agree with you, I have
Hey admin, Iam confused. You
@admin.... My code is running
whats wrong with my programme
can we still submit
did anyone notice there are