Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
134491 | 李树强 | 第k小数1 | C++ | 解答错误 | 90 | 26 MS | 1032 KB | 362 | 2024-03-02 16:01:40 |
#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 = 1; i <= n; i++){ cin >> a[i].x; a[i].y = i; } sort(a + 1, a + 1 + n); cout << a[k].y; return 0; }