题目
分析
- 贪心,但好像暴力能过??
- 其实放一天也就是在本来的存放加上一个
代码
1 #include<iostream>
2 using namespace std;
3 int main()
4 {
5 long long n, m;
6 cin>>n>>m;
7 long long ans=0,minn=0x7f7f7f7f;
8 for (int i=1;i<=n;i++)
9 {
10 long long x,w;
11 cin>>w>>x;
12 minn=min(minn+m,w);
13 ans+=minn*x;
14 }
15 cout<<ans;
16 }