Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
36393 | Jeremy | 谁考了第k名 | C++ | Accepted | 0 MS | 252 KB | 329 | 2024-01-13 13:09:12 |
#include<bits/stdc++.h> using namespace std; struct s{ int id; double score; }a[10005]; bool cmp(s a,s b){ return a.score>b.score; } int main() { int x,k; cin>>x>>k; for(int i=1;i<=x;i++){ cin>>a[i].id >>a[i].score ; } sort(a+1,a+1+x,cmp); cout<<a[k].id<<" "<<a[k].score <<endl; return 0; }