啊啊啊啊啊啊啊啊啊啊
我ctal+a全选多加了个a
http://go.helloworldroom.com:50080/submission/70711
#include<iostream>
#include<algorithm>
using namespace std;
struct friends{
int w,c,d;
int tot;
int ordering;
};
bool cmp(friends x,friends y){
return x.w>y.w;
}
bool cmp2(friends x,friends y){
return x.tot>y.tot;
}
int main(){
int n,k;
cin>>n>>k;
friends a[n];
int e[10];
for(int i=0;i<n;i++){
a[i].ordering=i+1;
cin>>e[i];
}
for(int i=0;i<n;i++){
cin>>a[i].w;
a[i].tot+=a[i].w;
}
sort(a,a+n,cmp);
for(int i=0;i<n;i++){
a[i].d=i+1;
a[i].c=(a[i].d-1)%10+1;
}
for(int i=0;i<n;i++){
a[i].tot+=e[a[i].c];
}a
sort(a,a+n,cmp2);
for(int i=0;i<k;i++){
cout<<a[i].ordering<<" ";
}
return 0;
}
此处省略无数芬芳