提交时间:2024-03-02 15:54:28
运行 ID: 134443
#include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n, k; struct gp{ int x, y; bool operator < (const gp & o) const{ return x < o.x; } } a[N]; int main(){ cin >> n >> k; for(int i = 0; i < n; i++){ cin >> a[i].x; a[i].y = i + 1; } sort(a, a + n); cout << a[k - 1].y; return 0; }