题解 | #牛牛的书#
牛牛的书
https://www.nowcoder.com/practice/30bb969e117b4f6d934d4b60a2af7489
#include <cstdio> #include <iostream> #include <map> #include <string> using namespace std; int main() { int n; cin >> n; map<int, string> m; string name; int price; while (cin >> name >> price) { m.insert(make_pair(price, name)); } for (auto i : m) { cout << i.second << "\n"; } } // 64 位输出请用 printf("%lld")