xkyxky @ 2019-03-02 19:54:52
为啥错了???
using namespace std;
int i,i1;
int n,s,a,b;
int xi[100],yi[100];
int main(){
cin>>n>>s>>a>>b;
for (i=1;i<=n;i++){
cin>>xi[n]>>yi[n];
}
a=a+b;
for(i=1;i<=n;i++){
if(xi[i]>=a){
n++;
for(i1=++i;i1<=n;i1++){
xi[i1--]=xi[i1];
yi[i1--]=yi[i1];
}
n-=2;
}
}
sort(yi+1,yi+n+1);
for(i=1;i<=n;i++){
bool l=false;
s=s-yi[i];
if(s<0){
i--;
l=true;
}
if(l) break;
}
b=i;
cout<<b;
}
by aminoas @ 2019-03-02 19:55:41
希望更丰富的展现?使用Markdown
by aminoas @ 2019-03-02 19:57:38
by 吴勉之 @ 2019-03-02 20:09:22
cin>>xi[n]>>yi[n] ?????
蒟蒻膜拜巨佬中
@xkyxky
by 吴勉之 @ 2019-03-02 20:09:57
@xkyxky cin>>xi[i]>>yi[i];吧
by aminoas @ 2019-03-02 20:14:43
蒟蒻膜拜巨佬中
@吴勉之
刷100道红题和橙题的大佬
by 吴勉之 @ 2019-03-02 20:16:51
蒟蒻膜拜神仙中
@吴勉之
刷15道黑题和24道紫题的神仙
by aminoas @ 2019-03-02 20:17:55
15道全是水题。。。
by aminoas @ 2019-03-02 20:18:18
话说你at自己干啥...
by aminoas @ 2019-03-02 20:19:25
还有,不要%我。
大号是@2018C1605 !