题目链接
送分题
#include <cstdio>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
struct node {
string id;
string name;
int gr;
}stu[100000];
bool cmp (node a, node b) {
return a.gr >= b.gr;
}
int n, c;
int main() {
cin >> n;
int p, q;
for (int i = 0; i < n; i++) cin >> stu[i].name >> stu[i].id >> stu[i].gr;
sort(stu, stu + n, cmp);
bool f = 0;
cin >> p >> q;
for (int i = 0; i < n; i++) {
if (stu[i].gr >= p && stu[i].gr <= q) {
f = 1;
cout << stu[i].name << " " << stu[i].id <<endl;
}
}
if (!f) cout << "NONE" <<endl;
return 0;
}