提交时间:2024-11-11 11:55:16
运行 ID: 56396
#include <iostream> #include <map> #include <algorithm> #include <vector> using namespace std; int n; struct node { string id; int old; int bianhao; }a[100005]; bool cmp(node x, node y) { if (x.old == y.old || (x.old < 60 && y.old < 60))return x.bianhao < y.bianhao; return x.old > y.old; } int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i].id; cin >> a[i].old; a[i].bianhao = i; } sort(a + 1, a + 1 + n, cmp); for (int i = 1; i <= n; i++) { cout << a[i].id << endl; } }