Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
110043 黄一航 第k小数1 C++ 解答错误 90 27 MS 1824 KB 673 2023-11-12 10:03:59

Tests(9/10):


#include <bits/stdc++.h> #define int long long using namespace std; inline int read() { int res = 0,f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) { res = (res << 1) + (res << 3) + (c - 48); c = getchar(); } return res * f; } struct node { int id,val; bool operator<(node x) { return val < x.val; } }a[100005]; int n,k; signed main() { n = read();k = read(); for (int i = 1; i <= n; i++) { cin >> a[i].val; a[i].id = i; } sort(a + 1,a + n + 1); printf("%lld\n",a[k].id); return 0; }


测评信息: