Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
36389 | Jeremy | 谁考了第k名 | C++ | Compile Error | 0 MS | 0 KB | 332 | 2024-01-13 13:07:23 |
#include<bits/stdc++.h> using namespace std; struct s{ int id; double score; }a[10005]; bool cmp(node a,node 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<<s[k].id<<" "<<s[k].score <<endl; return 0; }