5 2 3 1 4 1 5 9 2 6 5 3 3 5
17 Here is a way for Takahashi to get all items he wants with the smallest total amount of money. * Initially, five items, Items $1, 2, 3, 4, 5$, are remaining. Choose $j = 5$ to buy the item with the fifth smallest item number among the remaining, Item $5$, for $A_5 + C_5 = 5 + 3 = 8$ yen. * Then, four items, Items $1, 2, 3, 4$, are remaining. Choose $j = 2$ to buy the item with the second smallest item number among the remaining, Item $2$, for $A_2 + C_2 = 1 + 2 = 3$ yen. * Then, three items, Items $1, 3, 4$, are remaining. Choose $j = 2$ to buy the item with the second smallest item number among the remaining, Item $3$, for $A_3 + C_2 = 4 + 2 = 6$ yen. Now, Takahashi has all items he wants, Items $3$ and $5$, (along with Item $2$, which is not wanted) for a total cost of $8 + 3 + 6 = 17$ yen, the minimum possible.
20 8 29 27 79 27 30 4 93 89 44 88 70 75 96 3 78 39 97 12 53 62 32 38 84 49 93 53 26 13 25 2 76 32 42 34 18 77 14 67 88 12 1 3 4 5 8 14 16 20
533
{
"problem": {
"name": "Wish List",
"description": {
"content": "There are $N$ items in a shop, numbered as Item $1$, Item $2$, $\\ldots$, Item $N$. For each $i = 1, 2, \\ldots, N$, the **regular price** of Item $i$ is $A_i$ yen. For each item, there is only one in",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc288_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There are $N$ items in a shop, numbered as Item $1$, Item $2$, $\\ldots$, Item $N$. \nFor each $i = 1, 2, \\ldots, N$, the **regular price** of Item $i$ is $A_i$ yen. For each item, there is only one in...",
"is_translate": false,
"language": "English"
}
]
}