Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
49125 sql517843786 网线主管 C++ 解答错误 3 MS 4160 KB 534 2024-06-19 22:01:48

Tests(0/1):


#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; } }


测评信息: