ramprakash_k's blog

By ramprakash_k, history, 9 years ago, In English

Is it possible for the admins to add this small feature :

Display the time of submission of the submission that is currently being tested.

Something like in this image : http://imgur.com/Vw51quG

Full text and comments »

  • Vote: I like it
  • +25
  • Vote: I do not like it

By ramprakash_k, 10 years ago, In English

There are n>0 people standing in a queue. Their heights are a permutation of {1,2,...,n}.
There are m>0 ships ready for departure.
You can do 2 operations : (in the order of the queue)
-> Allot a boat i (1<=i<=m) for the person in the front of the queue.
-> Deny him service (send him away).
There is one constraint though. A person will board the ship allotted to him only if all the people already in that ship have lesser height than him (else he feels inferior).
As the manager, you need to find a way to maximize the number of people that can board these m ships.
(Sorry I dont remember the exact constraints on m,n but they are pretty big)
Input :
n m
a1 a2 a3 ... an
Output :
k
(a single integer 0<k<=n which is the maximum people that can be allotted to these m ships)
Example :
5 2
4 2 5 1 3
Output :
4

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it