yuguoyu @ 2021-11-24 10:00:42
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<queue>
#define ll long long
#define MAXN 1000100
using namespace std;
int main()
{
long long a[5100],x,w,v,n,t,s[5100];
cin>>v>>n;
cin>>t>>x;
for(int i=0;i<v;i++)
cin>>a[i]>>s[i];
sort(s,s+v);
for(int i=0;i<v;i++)
{
if((x>=a[i]&&n>=s[i])||(x+t>=a[i]&&n>=s[i]))
{
n-=s[i];
w++;
}
}
cout<<w;
}
by _wzcxx @ 2021-11-24 10:02:49
@zhanan
by _wzcxx @ 2021-11-24 10:03:03
@zhanan
by _wzcxx @ 2021-11-24 10:03:19
@zhanan
by Konnyaku_k @ 2021-11-24 10:04:27
@zhanan
by Konnyaku_k @ 2021-11-24 10:04:41
@zhanan
by Konnyaku_k @ 2021-11-24 10:04:58
@zhanan
by Konnyaku_q @ 2021-11-24 10:07:45
@zhanan
by Konnyaku_q @ 2021-11-24 10:08:15
@zhanan
by Konnyaku_q @ 2021-11-24 10:08:34
@zhanan
by ajahjahah @ 2021-11-24 10:17:48
???你们有问题吧