提交时间:2023-11-14 14:02:45
运行 ID: 110332
#include<bits/stdc++.h> using namespace std; unsigned long long an[10000]; unsigned long long bn[10000]; int main() { int a,b; cin>>a>>b; for(unsigned long long i=1;i<=a;i++){ cin>>bn[i]; an[i]=i; } for(unsigned long long i=1;i<=b;i++){ int m; for(unsigned long long o=i;o<=a;o++){ if(bn[i]>bn[o]){ m=o; } } swap(an[m],an[i]); swap(bn[m],bn[i]); } cout<<an[b]; return 0; }