Блог пользователя ramprakash_k

Автор ramprakash_k, история, 8 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +25
  • Проголосовать: не нравится

Автор ramprakash_k, 9 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится