Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
36468 | C++|刘一阳 | 谁考了第k名 | C++ | 解答错误 | 0 MS | 248 KB | 299 | 2024-01-13 16:01:12 |
#include<bits/stdc++.h> using namespace std; struct node{ int id; double f; }a[1000]; bool cmp(node a,node b){ return a.f<b.f; } int main() { int i,m,n; cin>>n>>m; for(i=0;i<n;i++){ cin>>a[i].id>>a[i].f; sort(a,a+n,cmp); printf("%d %g",a[m].id,a[m].f); } return 0; }