全部评论 1

  • #include <bits/stdc++.h>
    using namespace std;
    int n,m,sum = 0,mn1 = 22;
    struct p{
    	string b;
    	int c,d;
    }a[114];
    bool cmp(p q,p w){
    	return q.d > w.d;
    }
    int main(){
        cin >> n >> m;
        for(int i = 0;i < n;i ++){
        	cin >> a[i].b >> a[i].c >> a[i].d;
        	mn1 = min(mn1,a[i].c);
    	}
    	if(m < mn1){
    		cout << "...>_<..." << endl;;
    	}
    	sort(a,a + n,cmp);
    	for(int i = 0;i < n;i ++){
        	if(m >= a[i].c){
        		cout << a[i].b << " " << a[i].c << " " << a[i].d << endl;
        		break;
    		}
    	}
        return 0;
    }
    

    2024-08-30 来自 北京

    0
首页