提交时间:2024-11-09 22:41:31
运行 ID: 56260
#include<iostream> using namespace std; struct fish { int price; int bl_price; }; int main() { int n; fish arr[105]; cin>>n; for(int i=0;i<n;i++) cin>>arr[i].price>>arr[i].bl_price; int mn=1e9,cnt=0; for(int i=0;i<n;i++) { mn=min(mn,arr[i].price); cnt+=mn; mn+=arr[i].bl_price; } cout<<cnt; return 0; }