mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
parent
3a90be3bcc
commit
a94676f490
32
QUSTOJ/1092_972964894.cpp
Normal file
32
QUSTOJ/1092_972964894.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include<iostream>
|
||||
#include<algorithm>
|
||||
using namespace std;
|
||||
struct leaf{
|
||||
long long x,y,z;
|
||||
}a[50000];
|
||||
long long n,k,w[10],i;
|
||||
|
||||
bool cmp(leaf a,leaf b){
|
||||
return (a.x>b.x) || (a.x==b.x && a.z<b.z);
|
||||
}
|
||||
|
||||
int main(){
|
||||
cin>>n>>k;
|
||||
for (i=0;i<10;i++) cin>>w[i];
|
||||
for (i=0;i<n;i++){
|
||||
cin>>a[i].x;
|
||||
a[i].z=i+1;
|
||||
}
|
||||
sort(a,a+n,cmp);
|
||||
for (i=0;i<n;i++){
|
||||
a[i].y=i;
|
||||
a[i].x+=w[a[i].y%10];
|
||||
}
|
||||
sort(a,a+n,cmp);
|
||||
for (i=0;i<k;i++){
|
||||
cout<<a[i].z;
|
||||
if (i+1==k) cout<<endl;
|
||||
else cout<<' ';
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user