提交时间:2026-04-12 20:13:06
运行 ID: 436378
#include<bits/stdc++.h> using namespace std; struct hsg{ string a; long long b; }; bool cmp(const hsg& x,const hsg& y){ return x.b<y.b; } int main(){ hsg arr[106]; int n,q; cin>>n>>q; for(int i=1;i<=n;i++){ cin>>arr[i].a>>arr[i].b; } sort(arr+1,arr+n+1,cmp); cout<<arr[q].a<<endl; return 0; }