WENWIN @ 2023-07-18 15:15:02
WA求助
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
您是让我们写代码吗???
by lovely_fcukh @ 2023-07-18 15:19:17
@WENWIN
by Rebirth_Yun @ 2023-07-18 15:20:25
提问的艺术
by sapnep @ 2023-07-27 09:49:59
#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 YXY0818 @ 2024-10-17 19:55:50
哈哈