考点:贪心+小模拟。
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mn = 40, days = 23;
ll g[mn], blue = 25, profit, h;
ll price()
{
return 11 * pow(2, 1. * h / 25);
}
ll f(ll n)
{
return 20 * (1 <= n && n <= 6) + 35 * (7 <= n && n <= 12) + 50 * (13 <= n && n <= 18) + 80 * (19 <= n);
}
signed main()
{
cin.tie(0)->ios::sync_with_stdio(false);
for (ll i = 1; i <= days; ++i)
{
cin >> g[i];
}
for (ll i = 1; i <= days; ++i)
{
ll expect = (days - i + 1) + 6; //还能赚多少
while (blue >= price() && price() < expect) //够钱买,能赚钱
{
blue -= price();
profit -= price();
++h;
}
blue += h + f(i) + g[i];
profit += h;
}
profit += 6 * h;
cout << profit;
return 0;
}