Statistics

Problem Statement for "SpireAttack"

Problem Statement

You are playing Slay the Spire, an excellent deck-builder strategic game. You are currently taking a turn in a combat.

You have N cards in your hand. All the cards in your hand are attack cards. Each of them has a cost (some number of actions you have to spend on using the card) and an effect (the amount of damage it deals to the opponent).

You are given the description of the cards: the int[]s actions and damage. Each of these arrays has exactly N elements. For each valid index i, you have a card that costs actions[i] actions and deals damage[i] damage. You can only play each card once.


You can spend up to three actions on playing your cards this turn.

Calculate and return the maximum total amount of damage you can deal.

Definition

Class:
SpireAttack
Method:
dealMostDamage
Parameters:
int, int[], int[]
Returns:
int
Method signature:
int dealMostDamage(int N, int[] actions, int[] damage)
(be sure your method is public)

Notes

  • You may have multiple copies of the same card in your hand. Each of them should be treated just like any other card - i.e., as a separate card that can be played once. (See Example 5.)

Constraints

  • N will be between 1 and 50, inclusive.
  • actions will have exactly N elements.
  • Each element of actions will be between 1 and 3, inclusive.
  • damage will have exactly N elements.
  • Each element of damage will be between 1 and 99, inclusive.

Examples

  1. 3

    {1, 1, 1}

    {2, 4, 6}

    Returns: 12

    You can play all three cards and deal 2+4+6 damage.

  2. 4

    {1, 1, 1, 1}

    {2, 4, 8, 6}

    Returns: 18

    Here you only have enough actions to play any three out of these four cards. Clearly, the best solution is to deal 4+6+8 damage.

  3. 2

    {2, 2}

    {5, 6}

    Returns: 6

    Here we can only play one of these two cards. After we do so, we will be left with one action, but the remaining card requires two actions to play.

  4. 3

    {2, 2, 1}

    {5, 6, 1}

    Returns: 7

    A similar solution to the previous example but now we also have a card that can be played for one action. An optimal solution is to spend two actions on the card that deals 6 damage and then the remaining action on the card that deals 1 damage.

  5. 3

    {1, 2, 3}

    {1, 4, 9}

    Returns: 9

    Here we could play the first two cards, but that would only deal 1+4 = 5 damage. A better solution is to play only the third card, which deals 9 damage.

  6. 8

    {1, 2, 1, 3, 1, 2, 1, 1}

    {1, 1, 1, 1, 1, 1, 1, 1}

    Returns: 3

    We can deal three damage by playing any three of the five cards that cost 1 action each.

  7. 3

    {1, 2, 3}

    {1, 7, 9}

    Returns: 9

  8. 3

    {1, 2, 3}

    {3, 7, 9}

    Returns: 10

  9. 36

    {2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 1, 2, 3, 1, 1, 1, 2, 2, 3, 3, 1, 2, 3, 2, 1, 1, 3, 3, 2, 2, 1, 1, 3, 2, 3, 3}

    {77, 44, 72, 74, 98, 26, 31, 94, 5, 17, 43, 13, 47, 75, 50, 66, 70, 33, 13, 84, 30, 90, 43, 28, 61, 96, 15, 99, 54, 78, 46, 87, 37, 99, 31, 72}

    Returns: 258

  10. 27

    {3, 3, 1, 2, 2, 3, 2, 2, 3, 3, 1, 3, 1, 3, 1, 2, 2, 2, 3, 3, 1, 2, 1, 1, 3, 3, 1}

    {60, 60, 19, 37, 41, 54, 39, 37, 59, 58, 20, 59, 19, 59, 21, 41, 37, 41, 54, 58, 17, 36, 18, 19, 60, 59, 17}

    Returns: 62

  11. 7

    {1, 1, 1, 1, 3, 3, 2}

    {14, 35, 57, 1, 84, 16, 54}

    Returns: 111

  12. 3

    {1, 2, 1}

    {11, 29, 16}

    Returns: 45

  13. 50

    {3, 3, 1, 3, 1, 1, 1, 3, 2, 3, 1, 3, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 2, 1, 3, 3, 3, 1, 3, 3, 2, 3, 3, 1, 3, 2, 2, 3, 1, 1, 2, 2, 2, 2, 3, 2, 3, 1, 1, 3}

    {96, 90, 31, 96, 32, 32, 34, 90, 65, 96, 30, 96, 33, 93, 32, 59, 34, 29, 30, 65, 30, 91, 62, 28, 94, 90, 95, 31, 93, 92, 64, 94, 95, 33, 95, 59, 63, 91, 34, 33, 61, 59, 65, 61, 94, 62, 93, 28, 33, 96}

    Returns: 102

  14. 3

    {3, 3, 2}

    {53, 99, 88}

    Returns: 99

  15. 9

    {1, 3, 2, 2, 2, 3, 2, 1, 1}

    {47, 7, 45, 75, 8, 51, 82, 35, 33}

    Returns: 129

  16. 12

    {1, 2, 3, 2, 2, 2, 2, 3, 1, 1, 3, 2}

    {6, 6, 10, 6, 7, 9, 9, 8, 2, 1, 8, 3}

    Returns: 15

  17. 7

    {2, 2, 2, 1, 3, 3, 3}

    {41, 72, 3, 78, 87, 49, 77}

    Returns: 150

  18. 50

    {3, 3, 2, 1, 1, 3, 1, 3, 1, 2, 2, 1, 1, 2, 1, 3, 2, 1, 3, 1, 3, 1, 3, 2, 1, 2, 2, 3, 2, 3, 2, 3, 1, 3, 2, 1, 1, 2, 2, 3, 1, 3, 1, 3, 2, 2, 2, 3, 1, 2}

    {56, 96, 26, 41, 51, 10, 17, 92, 63, 43, 84, 84, 14, 33, 63, 12, 46, 4, 51, 80, 11, 77, 29, 67, 83, 27, 65, 33, 92, 98, 40, 65, 78, 15, 72, 8, 37, 93, 23, 63, 90, 31, 52, 79, 61, 1, 76, 52, 78, 31}

    Returns: 257

  19. 38

    {2, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 3, 2, 2, 1, 2, 2, 3, 3, 1, 3, 2, 1, 3, 2, 1, 1, 1, 3, 1, 2, 1, 2}

    {65, 70, 74, 97, 99, 88, 46, 67, 67, 55, 82, 57, 56, 87, 53, 94, 63, 3, 25, 42, 7, 77, 55, 13, 57, 99, 75, 16, 13, 43, 56, 95, 8, 43, 97, 24, 86, 53}

    Returns: 291

  20. 50

    {3, 3, 1, 1, 1, 3, 1, 3, 2, 2, 1, 3, 1, 2, 1, 1, 3, 3, 2, 1, 3, 3, 3, 1, 2, 2, 1, 3, 1, 2, 2, 1, 1, 2, 3, 1, 3, 2, 3, 3, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3}

    {30, 35, 52, 8, 4, 51, 25, 99, 54, 47, 67, 12, 45, 93, 80, 81, 44, 57, 9, 9, 61, 35, 9, 21, 27, 30, 55, 61, 26, 38, 1, 15, 78, 73, 2, 33, 69, 28, 69, 48, 61, 28, 43, 52, 5, 87, 83, 76, 54, 42}

    Returns: 239

  21. 32

    {1, 1, 2, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 2, 2, 1, 1, 2, 3, 3, 2, 3, 2, 1, 1, 2, 3, 3, 2, 1, 3, 2}

    {53, 94, 93, 43, 93, 12, 33, 54, 48, 13, 91, 49, 49, 23, 38, 4, 4, 74, 87, 74, 25, 17, 72, 29, 12, 1, 55, 55, 54, 91, 55, 75}

    Returns: 238

  22. 5

    {3, 3, 3, 2, 3}

    {34, 82, 83, 19, 10}

    Returns: 83

  23. 1

    {3}

    {18}

    Returns: 18

  24. 2

    {3, 2}

    {71, 96}

    Returns: 96

  25. 50

    {1, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 3, 2, 2, 2, 3, 1, 1, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 1, 3, 3, 2, 1, 2, 2, 1, 3, 1, 3, 1, 2, 3, 2}

    {2, 5, 8, 4, 7, 7, 2, 1, 2, 2, 4, 7, 2, 5, 3, 6, 5, 4, 3, 5, 8, 2, 1, 6, 4, 2, 5, 3, 6, 3, 8, 6, 6, 4, 6, 1, 5, 4, 4, 3, 3, 5, 4, 5, 1, 7, 1, 5, 6, 6}

    Returns: 10

  26. 3

    {1, 1, 3}

    {22, 16, 56}

    Returns: 56

  27. 39

    {2, 2, 3, 3, 1, 2, 2, 3, 3, 3, 3, 2, 3, 1, 3, 1, 2, 2, 2, 1, 1, 3, 1, 2, 2, 2, 1, 2, 1, 1, 2, 3, 3, 1, 1, 3, 2, 2, 1}

    {84, 3, 84, 99, 76, 20, 14, 54, 39, 29, 53, 97, 25, 12, 28, 83, 82, 86, 29, 71, 12, 72, 54, 40, 41, 48, 16, 12, 89, 41, 59, 28, 99, 16, 84, 12, 69, 86, 44}

    Returns: 256

  28. 50

    {1, 2, 2, 3, 3, 3, 2, 2, 3, 1, 1, 2, 2, 3, 1, 3, 3, 2, 2, 2, 2, 3, 1, 3, 3, 3, 3, 2, 3, 3, 1, 3, 1, 1, 1, 1, 1, 3, 3, 3, 3, 2, 3, 3, 2, 1, 2, 3, 3, 3}

    {65, 23, 96, 42, 48, 24, 21, 85, 94, 64, 10, 5, 51, 60, 89, 58, 38, 80, 13, 82, 90, 64, 81, 35, 43, 37, 89, 28, 90, 55, 10, 33, 79, 49, 42, 59, 38, 21, 31, 24, 47, 30, 40, 5, 28, 89, 74, 61, 4, 46}

    Returns: 259

  29. 1

    {2}

    {97}

    Returns: 97

  30. 15

    {2, 1, 1, 3, 1, 3, 2, 2, 1, 1, 1, 2, 3, 2, 3}

    {7, 3, 6, 10, 1, 7, 9, 9, 1, 2, 5, 5, 7, 7, 11}

    Returns: 15

  31. 50

    {2, 2, 2, 3, 1, 1, 2, 1, 1, 1, 1, 3, 3, 3, 2, 3, 3, 1, 2, 3, 3, 3, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 2, 1, 3, 1, 1, 1, 1, 3, 1, 3, 3, 3, 3, 3, 1, 2, 1, 2}

    {13, 11, 13, 19, 8, 10, 17, 7, 8, 9, 5, 24, 24, 19, 12, 23, 22, 10, 12, 22, 20, 20, 23, 23, 7, 17, 18, 6, 12, 23, 4, 14, 12, 6, 23, 7, 5, 7, 4, 20, 9, 19, 21, 22, 19, 24, 5, 12, 8, 11}

    Returns: 29

  32. 13

    {3, 2, 3, 2, 3, 2, 3, 1, 2, 1, 1, 3, 2}

    {31, 38, 59, 23, 23, 71, 39, 59, 38, 38, 79, 95, 7}

    Returns: 176

  33. 17

    {3, 1, 3, 3, 2, 3, 3, 2, 1, 2, 2, 3, 3, 1, 3, 3, 2}

    {70, 24, 33, 52, 42, 43, 16, 49, 56, 18, 12, 95, 56, 32, 31, 1, 33}

    Returns: 112

  34. 1

    {2}

    {92}

    Returns: 92

  35. 12

    {1, 3, 1, 1, 1, 3, 2, 2, 1, 3, 2, 2}

    {99, 77, 48, 27, 7, 34, 63, 30, 86, 14, 68, 40}

    Returns: 233

  36. 7

    {2, 3, 3, 3, 1, 3, 2}

    {23, 36, 37, 34, 12, 36, 23}

    Returns: 37

  37. 50

    {1, 1, 1, 2, 3, 1, 2, 2, 1, 1, 3, 3, 1, 1, 1, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 1, 1, 2, 2, 3, 1, 3, 3, 3, 1, 1, 3, 2, 3, 3, 3, 1, 1, 3, 1, 1, 3, 2, 1, 3}

    {30, 32, 63, 48, 26, 55, 24, 60, 77, 79, 29, 5, 99, 53, 60, 30, 55, 99, 3, 55, 80, 66, 9, 63, 25, 51, 25, 93, 1, 31, 64, 67, 2, 71, 38, 62, 41, 40, 79, 90, 86, 67, 91, 89, 96, 81, 65, 49, 80, 29}

    Returns: 286

  38. 1

    {1}

    {76}

    Returns: 76

  39. 50

    {2, 3, 2, 1, 2, 2, 1, 3, 3, 2, 3, 3, 1, 3, 2, 3, 2, 2, 1, 1, 1, 1, 3, 2, 3, 2, 1, 2, 3, 2, 1, 3, 3, 3, 1, 1, 1, 1, 2, 1, 1, 3, 1, 2, 3, 3, 2, 3, 1, 3}

    {35, 53, 34, 15, 34, 34, 15, 53, 51, 36, 51, 52, 19, 53, 35, 50, 34, 33, 16, 15, 15, 15, 52, 35, 50, 36, 19, 33, 51, 32, 19, 50, 53, 50, 18, 18, 18, 15, 35, 16, 19, 53, 17, 36, 50, 52, 35, 50, 16, 50}

    Returns: 57

  40. 13

    {1, 3, 3, 3, 1, 3, 2, 1, 2, 3, 3, 2, 3}

    {71, 56, 88, 3, 22, 75, 55, 52, 5, 72, 7, 8, 78}

    Returns: 145

  41. 2

    {2, 1}

    {18, 9}

    Returns: 27

  42. 50

    {1, 3, 3, 1, 2, 2, 1, 2, 3, 2, 2, 1, 1, 2, 2, 2, 1, 2, 3, 1, 2, 3, 1, 3, 3, 1, 2, 1, 1, 3, 3, 1, 1, 2, 3, 3, 1, 2, 3, 3, 3, 3, 3, 1, 2, 1, 1, 1, 3, 3}

    {19, 36, 48, 19, 43, 86, 69, 48, 17, 19, 55, 53, 74, 41, 87, 24, 78, 49, 3, 14, 55, 96, 22, 88, 9, 13, 17, 14, 10, 28, 4, 24, 50, 13, 9, 72, 62, 96, 3, 16, 23, 43, 86, 94, 17, 90, 17, 36, 29, 18}

    Returns: 262

  43. 1

    {1}

    {71}

    Returns: 71

  44. 1

    {1}

    {66}

    Returns: 66

  45. 3

    {1, 2, 2}

    {2, 7, 6}

    Returns: 9

  46. 25

    {2, 3, 2, 1, 2, 3, 3, 3, 2, 3, 1, 3, 3, 1, 1, 3, 1, 3, 2, 1, 2, 2, 2, 1, 3}

    {43, 66, 47, 22, 44, 68, 68, 71, 43, 70, 21, 70, 69, 23, 24, 68, 21, 68, 45, 25, 46, 44, 46, 21, 70}

    Returns: 72

  47. 50

    {1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 2, 1, 3, 1, 3, 1, 3, 2, 2, 3, 1, 2, 2, 2, 2, 1, 1, 3, 2, 1, 2, 3, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 2, 3, 3, 2, 1, 3, 1, 1}

    {5, 5, 7, 3, 2, 4, 6, 10, 3, 10, 6, 4, 12, 3, 13, 2, 10, 7, 10, 11, 6, 7, 10, 6, 9, 4, 4, 10, 10, 6, 8, 11, 14, 6, 14, 10, 12, 10, 4, 9, 6, 10, 8, 12, 11, 8, 3, 12, 5, 4}

    Returns: 18

  48. 10

    {2, 3, 1, 2, 1, 3, 2, 2, 1, 1}

    {57, 83, 27, 56, 27, 83, 56, 57, 28, 27}

    Returns: 85

  49. 50

    {3, 3, 2, 1, 1, 1, 2, 3, 1, 2, 1, 1, 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 3, 2, 3, 2, 2, 2, 1, 1, 1, 1, 2, 3, 3, 3, 2, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 2}

    {8, 10, 6, 4, 3, 3, 6, 10, 2, 6, 4, 3, 8, 10, 5, 7, 3, 2, 2, 2, 6, 5, 9, 6, 8, 5, 7, 6, 2, 3, 2, 3, 7, 10, 9, 10, 7, 3, 8, 3, 8, 4, 3, 10, 4, 2, 4, 2, 10, 6}

    Returns: 12

  50. 50

    {1, 3, 2, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 1, 2, 2, 3, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 2, 3, 3, 3}

    {42, 48, 56, 22, 67, 84, 71, 69, 30, 64, 53, 96, 6, 45, 39, 80, 32, 61, 32, 27, 12, 64, 85, 49, 75, 28, 64, 4, 42, 32, 25, 43, 94, 76, 67, 29, 3, 51, 91, 6, 66, 75, 43, 72, 70, 42, 45, 82, 66, 59}

    Returns: 275

  51. 1

    {1}

    {8}

    Returns: 8

  52. 28

    {3, 3, 1, 1, 3, 3, 3, 2, 3, 2, 2, 2, 2, 3, 1, 2, 3, 3, 3, 1, 3, 3, 3, 1, 2, 2, 1, 3}

    {47, 70, 97, 79, 50, 91, 80, 98, 73, 81, 87, 57, 71, 80, 93, 1, 34, 37, 62, 33, 99, 72, 94, 85, 50, 21, 26, 51}

    Returns: 275

  53. 50

    {1, 2, 2, 1, 3, 3, 2, 3, 2, 3, 3, 1, 1, 3, 1, 1, 1, 2, 3, 2, 2, 1, 1, 3, 3, 2, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 3, 3, 1, 2, 3, 1, 1}

    {12, 24, 24, 12, 36, 36, 24, 36, 24, 36, 36, 12, 12, 36, 12, 12, 12, 24, 36, 24, 24, 12, 12, 36, 36, 24, 12, 24, 12, 36, 12, 24, 12, 12, 24, 12, 12, 12, 24, 12, 24, 12, 36, 36, 36, 12, 24, 36, 12, 12}

    Returns: 36

  54. 25

    {2, 3, 3, 1, 3, 2, 3, 2, 2, 2, 1, 1, 3, 1, 1, 3, 2, 3, 2, 3, 3, 2, 2, 2, 3}

    {12, 18, 18, 6, 18, 12, 18, 12, 12, 12, 6, 6, 18, 6, 6, 18, 12, 18, 12, 18, 18, 12, 12, 12, 18}

    Returns: 18

  55. 14

    {1, 3, 3, 3, 3, 3, 2, 1, 1, 1, 3, 1, 1, 1}

    {53, 89, 26, 29, 75, 18, 61, 72, 58, 10, 21, 40, 11, 85}

    Returns: 215

  56. 50

    {2, 3, 1, 1, 3, 1, 2, 3, 2, 2, 1, 1, 3, 3, 1, 1, 3, 2, 2, 2, 3, 3, 1, 3, 3, 2, 3, 2, 1, 1, 3, 3, 3, 1, 1, 2, 3, 2, 3, 3, 2, 2, 3, 2, 3, 3, 3, 2, 3, 1}

    {23, 55, 78, 15, 16, 93, 99, 97, 41, 49, 25, 29, 52, 89, 6, 20, 9, 99, 78, 24, 48, 46, 84, 56, 37, 92, 78, 8, 58, 56, 92, 3, 92, 93, 99, 71, 5, 3, 90, 7, 78, 16, 6, 14, 70, 15, 69, 32, 2, 70}

    Returns: 285

  57. 6

    {3, 2, 1, 1, 3, 3}

    {61, 24, 28, 28, 43, 90}

    Returns: 90

  58. 3

    {1, 1, 2}

    {4, 6, 64}

    Returns: 70

  59. 50

    {3, 1, 3, 2, 2, 2, 2, 3, 1, 2, 2, 3, 2, 3, 1, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 1, 1, 3, 1, 3, 2, 1, 1, 2, 1, 3, 2, 2, 1, 2, 1, 2, 1, 3, 2, 3, 1, 1, 3, 3}

    {14, 7, 16, 12, 10, 8, 11, 16, 4, 11, 8, 15, 11, 16, 4, 10, 10, 8, 12, 17, 10, 9, 13, 10, 10, 3, 6, 17, 6, 15, 11, 7, 4, 8, 7, 13, 11, 12, 7, 10, 3, 12, 4, 17, 11, 17, 7, 7, 14, 14}

    Returns: 21

  60. 50

    {3, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 2, 1, 2, 1, 3, 1, 2, 3, 2, 2, 1, 2, 3, 3, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 3, 3, 3, 1, 3, 2, 3, 3, 2}

    {48, 49, 47, 7, 44, 88, 55, 22, 84, 65, 21, 54, 91, 91, 99, 4, 33, 34, 45, 89, 8, 92, 73, 94, 63, 31, 79, 13, 40, 86, 72, 97, 10, 55, 63, 71, 68, 49, 46, 66, 25, 82, 74, 60, 27, 49, 62, 44, 32, 50}

    Returns: 228

  61. 28

    {2, 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, 2, 2, 3, 1, 2, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1}

    {94, 92, 34, 53, 5, 93, 25, 37, 95, 71, 8, 77, 23, 51, 11, 35, 61, 15, 8, 7, 20, 37, 75, 22, 61, 67, 88, 50}

    Returns: 280

  62. 2

    {2, 3}

    {55, 68}

    Returns: 68

  63. 11

    {2, 2, 1, 1, 2, 3, 1, 1, 3, 2, 2}

    {87, 28, 34, 33, 6, 49, 78, 49, 37, 83, 67}

    Returns: 165

  64. 4

    {2, 2, 1, 1}

    {54, 22, 20, 90}

    Returns: 144

  65. 7

    {1, 1, 3, 2, 2, 2, 1}

    {38, 84, 60, 64, 8, 4, 26}

    Returns: 148

  66. 1

    {1}

    {28}

    Returns: 28

  67. 30

    {3, 2, 2, 2, 2, 1, 3, 2, 3, 1, 2, 1, 1, 3, 2, 1, 3, 3, 3, 1, 3, 3, 1, 1, 3, 1, 3, 2, 1, 2}

    {47, 95, 58, 48, 9, 86, 97, 54, 57, 70, 35, 16, 90, 42, 2, 63, 73, 67, 68, 88, 41, 71, 60, 15, 86, 25, 57, 9, 32, 26}

    Returns: 264

  68. 21

    {2, 3, 2, 1, 2, 2, 2, 3, 3, 3, 1, 3, 2, 2, 1, 1, 3, 1, 2, 1, 2}

    {68, 98, 68, 34, 66, 67, 65, 97, 98, 99, 35, 97, 65, 66, 31, 31, 99, 35, 66, 31, 64}

    Returns: 104

  69. 4

    {3, 2, 1, 1}

    {1, 1, 10, 10}

    Returns: 20

  70. 2

    {1, 3}

    {2, 1}

    Returns: 2

    You do not have to spend all three actions. Here the optimal solution is to spend one action on playing the card that deals 2 damage. (You will be left with two unspent actions + a card you cannot play.)

  71. 6

    {1, 1, 2, 2, 3, 3 }

    {1, 5, 1, 2, 8, 6 }

    Returns: 8

  72. 50

    {1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3 }

    {4, 4, 4, 15, 4, 4, 4, 15, 4, 4, 4, 4, 4, 15, 4, 4, 4, 15, 4, 4, 4, 4, 4, 15, 4, 4, 4, 15, 4, 4, 4, 4, 4, 15, 4, 4, 4, 15, 4, 4, 4, 4, 4, 15, 4, 4, 4, 15, 4, 4 }

    Returns: 15

  73. 1

    {2 }

    {10 }

    Returns: 10

  74. 4

    {3, 1, 1, 1 }

    {4, 2, 2, 2 }

    Returns: 6

  75. 4

    {1, 1, 1, 2 }

    {3, 3, 3, 5 }

    Returns: 9


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: