提交时间:2023-11-08 13:09:57
运行 ID: 109259
#include <bits/stdc++.h> using namespace std; #define int long long struct node { long long id , shu; }a[1000010]; bool cmp(node x , node y) { if(x.shu != y.shu) return x.shu < y.shu; return x.id < y.id; } signed main() { long long n , k; cin >> n >> k; for(int i = 1;i <= n;i++) { cin >> a[i].shu; a[i].id = i; } sort(a + 1,a + n + 1,cmp); cout << a[k].id; return 0; }