You are not logged in. Please login at www.codechef.com to post your questions!

×

HackerEarth: Help Katekar

I couldn't understand what the following problem is trying to specify. Any inputs would be quite valuable.

asked 14 Mar, 23:24

aritra_roy's gravatar image

2★aritra_roy
1
accept rate: 0%


find a subset ( select some elements from array A) with maximum size (in short select maximum number of values from array A) such that the smallest value has smallest frequency and largest value selected has largest frequency and so on...
1 1 1 2 2 3 is not valid
1 2 2 3 3 3 is valid
1 3 3 5 5 5 5 is also valid
5 3 1 3 5 5 5 is also valid
1 2 3 3 is not valid as 1<2 but freq(1) is not < freq(2)

link

answered 14 Mar, 23:31

l_returns's gravatar image

5★l_returns
1.6k211
accept rate: 24%

edited 14 Mar, 23:33

so if A[i] < A[j] then freq(A[i]) < freq(A[j])

(14 Mar, 23:34) l_returns5★

Okay, thanks. That answer was helpful. I didn't get the question at first now I realized my mistake.

(16 Mar, 09:28) aritra_roy2★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,212

question asked: 14 Mar, 23:24

question was seen: 69 times

last updated: 16 Mar, 09:28