提交时间:2023-11-08 13:37:12

运行 ID: 109355

#include<bits/stdc++.h> using namespace std; #define int long long int n,m,k; int a[1000010],b[1000010]; signed main(){ cin>>n>>m; for(int i=1;i<=n;i++){ cin>>a[i]; b[i]=a[i]; } sort(a+1,a+n+1); for(int i=1;i<=n;i++){ if(b[i]==a[m]){ cout<<i<<endl; break; } } return 0; }