文章

43

粉丝

180

获赞

21

访问

180.8k

头像
c++(短代码)
P1159 清华大学上机题
发布于2022年4月26日 16:48
阅读数 4.6k

#include <iostream>
#include <algorithm>

using namespace std;

int n, a;
vector<pair<int, int>> s;

int main()
{
	cin >> n;
	while (cin >> n >> a) s.push_back({a, n});
	stable_sort(s.begin(), s.end());
	for (auto x : s) cout << x.second << ' ' << x.first << endl;
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发