-
个人简介
jl;jikgfyjnhjtyhtyhtyhjytrfgjuty #include <bits/stdc++.h> using namespace std; long long n,h,maxn,f[100001],ans,a[100001],b[100001]; int main() { cin>>n>>h; for(int i=1;i<=n;i++) cin>>a[i]>>b[i]; for(int i=1;i<=n;i++) { f[a[i]]++; maxn=max(maxn,a[i]); if(h-a[i]>0) h=h-a[i]+b[i]; else { ans++; h=h+maxn+b[i]-a[i]; f[maxn]--; for(int j=maxn;j>=0;j--) if(f[j]>0){ maxn=j; break; } } } cout<<ans; return 0; }
-
通过的题目
-
最近活动
This person is lazy and didn't join any contests or homework. -
最近编写的题解
This person is lazy and didn't write any solutions.