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

Автор amit_56, 12 месяцев назад, По-английски

There are n servers where the ith server can serve request[i] number of requests and has an initial health of health[i] units. Each second, the developers send the maximum possible number of requests that can be served by all the available servers. With the request, the developers can also send a virus to one of the servers that can decrease the health of a particular server by k units. The developers can choose the server where the virus should be sent. A server goes down when its health is less than or equal to 0. After all the servers are down, the developers must send one more request to conclude the failure of the application. Find the minimum total number of requests that the developers must use to bring all the servers down.

constraints :
1<=n<=1e5
1<=req[i],health[i]<=5e3
1<=k<=5e3

example =
n=2
k=3
req=[3,4]
health=[4,6]

ans = 21
can you share your approach for this problem. I didn't get idea how to solve it.

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

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

Автор amit_56, история, 18 месяцев назад, По-английски

I am trying to view sorce code of other people but continiously getting N/A instead of submited code can anyone please tell how to view other's submissions.

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

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