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

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

Given N stacks, each stack contains Si elements, find the maximum sum of the M numbers in the N stacks. To get the number of the stack, only supporting get the top number. For example, S=[1,200,1,2,3], if you want to get the number 200, you need choose 3,2,1 first. EX: S1=[1,1,100,3] S2=[2000,2,3,1] S3=[10,1,4] the maximum sum of the 3 numbers in the above stacks is 3+100+4=107. Any better solution for this problem?

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

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What are the constraints?

»
5 лет назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

https://codeforces.com/problemset/problem/148/E this problem is almost the same as the problem you presented and the solution idea is the same.