提交时间:2023-11-08 13:13:13
运行 ID: 109261
#include<bits/stdc++.h> using namespace std; int a[1000010]; int b[1000010]; int main(){ int n,k; scanf("%d",&n); scanf("%d",&k); for(int i = 0;i < n;i++){ scanf("%d",&a[i]); b[i] = a[i]; } sort(a,a+n); for(int j = 0;j < n;j++){ if(b[j] == a[k-1]){ printf("%d",j+1); } } }