Wish_kazdel @ 2024-07-23 20:07:26
#include<bits/stdc++.h>
using namespace std;
struct apple{
int x,y;
}awa[5005];
int n,s,a,b;
bool cmp(apple a,apple b){
return a.y<=b.y;
}
int main(){
cin>>n>>s>>a>>b;
for(int i=1;i<=n;i++){
cin>>awa[i].x>>awa[i].y;
}
sort(awa+1,awa+n+1,cmp);
int sum=a+b,t=s;
int cnt=0;
for(int i=1;i<=n;i++){
if(awa[i].x<=sum&&t-awa[i].y>=0){
cnt++;
t-=awa[i].y;
}
if(t-awa[i].y<0)break;
}
cout<<cnt;
return 0;
}
by Wish_kazdel @ 2024-07-23 20:37:05
@fire_flies 头像 貌似 也不是吧(我记得截这张是两年前截的了,长的跟某位角色相似吗awa)(我1.3退坑的,本人64级)
by fire_flies @ 2024-07-23 20:37:42
@Wish_kazdel 这不是黑塔吗
by Wish_kazdel @ 2024-07-23 20:39:27
@fire_flies !!!第一次发现原谅我是个脸盲(模拟宇宙白打了)