题解 | #小白鼠排队#
小白鼠排队
https://www.nowcoder.com/practice/27fbaa6c7b2e419bbf4de8ba60cf372b
#include "iostream" #include "string" #include "map" using namespace std; int main() { int num, iHeavy; while (cin >> num) { map<int, string> result; for (int i = 0; i < num; ++i) cin >> iHeavy >> result[iHeavy]; // input for (auto itor = result.rbegin(); itor != result.rend(); itor++) cout << itor->second << endl; // output } }