代码都没有。。。
by lovely_fcukh @ 2023-07-18 15:16:36
额
by Happy_Doggie @ 2023-07-18 15:17:05
您是让我们写代码吗???
by Happy_Doggie @ 2023-07-18 15:17:25
@[WENWIN](/user/1035790)
by lovely_fcukh @ 2023-07-18 15:19:17
[提问的艺术](https://www.luogu.com.cn/blog/StudyingFather/how-to-ask-questions-the-smart-way-luogu-edition)
by Rebirth_Yun @ 2023-07-18 15:20:25
```cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,g,h,m=0,n;
int c,d,e[50000],f[50000];
scanf("%d %d",&a,&b);
scanf("%d %d",&c,&d);
for(int i=1;i<=a;i++)
{
scanf("%d",&e[i]);
scanf("%d",&f[i]);
}
for(int i=1;i<=a-1;i++){
for(int j=i+1;j<=a;j++){
if(f[i]>f[j])
{
g=f[i];
f[i]=f[j];
f[j]=g;
h=e[i];
e[i]=e[j];
e[j]=h;
}
}
}
for(int i=1;i<=a;i++){
if(e[i]<=(c+d)&&b-f[i]>=0)
{
b=b-f[i];
m++;
}
}
cout<<m;
return 0;
}
```
by sapnep @ 2023-07-27 09:49:59